2016-12-21 21:36 GMT+01:00 Wouter In t Velt <[email protected]>:
> Seems input [ type_ "number" ] behaves weird in different ways.

Oh yes, definitely, I forgot to explicitly say that. :)

What I wanted to point out in my example is that defaultValue can't be
considered a viable solution not only because of the leakage of values, but
also because it doesn't handle very well cases where somebody provides
incorrect value for a HTML5 field.

BTW, the weirdness of the number input is related to how these inputs are
implemented in browsers, I think. I don't want to derail the thread, so
I'll just leave this little note: if you look at the debugger, you're going
to see that if you input an invalid value, an empty string is sent with the
onInput event. I believe this is not Elm-specific and this is how browsers
implement that. I made a snippet
<http://jsbin.com/wopobepagu/edit?html,js,console,output> which displays
such behavior in non-Elm environment. Elm's virtual DOM implementation must
be doing some hacks to work around this fact.


-- 
Rafał Cieślak

-- 
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