git.iko.soy/typeable/elm-ui
on master help sign in
Input.text: maintain order of `type`, then `value` for weird Edge bug
commit1b6a6c6cafb2f480de03fbf0502c73f8d0dad608 authorMatthew Griffith <mdg.griffith@gmail.com> dateSat 6 Jul 2019, 08:26 (7 years ago) parentdf18305
1 file changed+22−19
src/Element/Input.elm+22−19
src/Element/Input.elm+22−19
@@ -853,26 +853,29 @@ textHelper textInput attrs textOptions =
853853 TextArea ->
854854 Internal.NodeName "textarea"
855855 )
856− ([ value textOptions.text
857− , Internal.Attr (Html.Events.onInput textOptions.onChange)
858− , hiddenLabelAttribute textOptions.label
859− , spellcheck textInput.spellchecked
860− , Maybe.map autofill textInput.autofill
861− |> Maybe.withDefault Internal.NoAttribute
862− ]
863− ++ (case textInput.type_ of
864− TextInputNode inputType ->
865− [ Internal.Attr (Html.Attributes.type_ inputType)
866− , Internal.htmlClass classes.inputText
867− ]
856+ ((case textInput.type_ of
857+ TextInputNode inputType ->
858+ -- Note: Due to a weird edgecase in...Edge...
859+ -- `type` needs to come _before_ `value`
860+ -- More reading: https://github.com/mdgriffith/elm-ui/pull/94/commits/4f493a27001ccc3cf1f2baa82e092c35d3811876
861+ [ Internal.Attr (Html.Attributes.type_ inputType)
862+ , Internal.htmlClass classes.inputText
863+ ]
868864
869− TextArea ->
870− [ Element.clip
871− , Element.height Element.fill
872− , Internal.htmlClass classes.inputMultiline
873− , calcMoveToCompensateForPadding withDefaults
874− ]
875− )
865+ TextArea ->
866+ [ Element.clip
867+ , Element.height Element.fill
868+ , Internal.htmlClass classes.inputMultiline
869+ , calcMoveToCompensateForPadding withDefaults
870+ ]
871+ )
872+ ++ [ value textOptions.text
873+ , Internal.Attr (Html.Events.onInput textOptions.onChange)
874+ , hiddenLabelAttribute textOptions.label
875+ , spellcheck textInput.spellchecked
876+ , Maybe.map autofill textInput.autofill
877+ |> Maybe.withDefault Internal.NoAttribute
878+ ]
876879 ++ redistributed.input
877880 )
878881 (Internal.Unkeyed [])