git.iko.soy/typeable/elm-ui
on master help sign in
Change the order of text input type and value attributes

This works around a rather obscure bug in Microsoft Edge. Basically, I want to use an input with type date (knowing well that not every browser implements it), so I use: ```elm Element.Input.text [ htmlAttribute <| Html.Attributes.type_ "date" ] ``` This works well in most browsers, but it seems to trigger a weird edge case bug in Microsoft Edge where it renders the date text _twice_, first in ISO8601, then in the normal way it renders dates in inputs with type date. So the text box contains both the texts "2019-03-08" and "3/8/2019". After quite a lot of experimentation, I found out that switching the order of these two attributes fixes the problem. I can only speculate as to why, but whatever it is it seems like it should be benign change to make.

commit4f493a27001ccc3cf1f2baa82e092c35d3811876 authorOlle Fredriksson <fredriksson.olle@gmail.com> dateFri 8 Mar 2019, 10:30 (8 years ago) parented45160
1 file changed+2−2
src/Element/Input.elm+2−2
src/Element/Input.elm+2−2
@@ -741,8 +741,8 @@ textHelper textInput attrs textOptions =
741741 case textInput.type_ of
742742 TextInputNode inputType ->
743743 ( "input"
744− , [ value textOptions.text
745− , Internal.Attr (Html.Attributes.type_ inputType)
744+ , [ Internal.Attr (Html.Attributes.type_ inputType)
745+ , value textOptions.text
746746 , spellcheck textInput.spellchecked
747747 , Internal.htmlClass classes.inputText
748748 , case textInput.autofill of