Is this a correct summary: Updating Html.Attributes.value is bad if the user types rapidly because it can fall behind user input and setting the value competes with typing but we want to set it when the value in the model changes for other reasons?
A couple of "solutions" come to mind: One is to track where the model value came from and only set the attribute if the value didn't come from the input. This makes the model a bit of a pain to work with particularly with respect to setting the values but it would seem to fix the problem. An almost solution would be to only set the attribute when the element does not have focus. This is only an almost solution because it will block programmatic updates when the element is focused. On the other hand, how do you know that the programmatic update isn't about to collide with the user typing? Another heuristic to throw in would be to start a timer on each input and only set the attribute if the element is not focused or sufficient time has elapsed since the last input event. Mark > On Mar 13, 2017, at 11:28 PM, Yosuke Torii <[email protected]> wrote: > > There have been many discussions about this, but please allow me to pick it > up again. > > As far as I know, the problem is briefly summarized as follows: > > `Html.Attributes.value` behaves crazily when we type rapidly. > `Html.Attributes.defaultValue` solves this but it does not allow to > programmatically change the value. There seems no solution for satisfying > both of these requirements. > > I believe this is very common requirement of web/gui apps. How do people > address this? Personally, I've been blocked on this for 6 months... So I > don't want a clean solution. Any workaround / hack is welcome. > > > -- > 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.
