> It'd be better for Elm, I think, if the browser just told you that
keystrokes happened and then let you decide when/how/whether to apply them,
but that's not the way input elements and their events work today.

Putting on my mad scientist hay: One could do that by formatting a normal
text element to look like an input, and listen to key events, right?
On Jun 19, 2016 3:36 PM, "Jason Merrill" <[email protected]> wrote:

> I'm not an expert in React, but I don't believe it has this problem (by
> default). It's totally possible to use virtual dom and still respond
> synchronously to input events, synchronously rendering DOM updates as
> necessary.
>
> The issue with Elm is that the runtime allows some time to pass between
> receiving the input event and calling your model/view update function, and
> then allows some more time to pass before rendering any updates to the DOM.
> I gave a few more details in an issue comment:
> https://github.com/evancz/elm-html/issues/51#issuecomment-226997749
>
> I don't see how it's possible to deal with input elements in a completely
> correct way if all your logic runs asynchronously, because the browser
> synchronously changes things in the DOM itself and then just tells you what
> it did. It'd be better for Elm, I think, if the browser just told you that
> keystrokes happened and then let you decide when/how/whether to apply them,
> but that's not the way input elements and their events work today.
>
> On Sun, Jun 19, 2016 at 11:55 AM Max Goldstein <[email protected]>
> wrote:
>
>> Is this a problem that React or other vdom-based rendering systems have?
>> If so, what's their workaround? If not, why not?
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Elm Discuss" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/elm-discuss/Juu6j827wyA/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to