mirror of
https://github.com/mdgriffith/elm-ui.git
synced 2024-11-29 07:18:39 +03:00
Input.text: maintain order of type
, then value
for weird Edge bug
This commit is contained in:
parent
df18305563
commit
1b6a6c6caf
@ -853,26 +853,29 @@ textHelper textInput attrs textOptions =
|
||||
TextArea ->
|
||||
Internal.NodeName "textarea"
|
||||
)
|
||||
([ value textOptions.text
|
||||
, Internal.Attr (Html.Events.onInput textOptions.onChange)
|
||||
, hiddenLabelAttribute textOptions.label
|
||||
, spellcheck textInput.spellchecked
|
||||
, Maybe.map autofill textInput.autofill
|
||||
|> Maybe.withDefault Internal.NoAttribute
|
||||
]
|
||||
++ (case textInput.type_ of
|
||||
TextInputNode inputType ->
|
||||
[ Internal.Attr (Html.Attributes.type_ inputType)
|
||||
, Internal.htmlClass classes.inputText
|
||||
]
|
||||
((case textInput.type_ of
|
||||
TextInputNode inputType ->
|
||||
-- Note: Due to a weird edgecase in...Edge...
|
||||
-- `type` needs to come _before_ `value`
|
||||
-- More reading: https://github.com/mdgriffith/elm-ui/pull/94/commits/4f493a27001ccc3cf1f2baa82e092c35d3811876
|
||||
[ Internal.Attr (Html.Attributes.type_ inputType)
|
||||
, Internal.htmlClass classes.inputText
|
||||
]
|
||||
|
||||
TextArea ->
|
||||
[ Element.clip
|
||||
, Element.height Element.fill
|
||||
, Internal.htmlClass classes.inputMultiline
|
||||
, calcMoveToCompensateForPadding withDefaults
|
||||
]
|
||||
)
|
||||
TextArea ->
|
||||
[ Element.clip
|
||||
, Element.height Element.fill
|
||||
, Internal.htmlClass classes.inputMultiline
|
||||
, calcMoveToCompensateForPadding withDefaults
|
||||
]
|
||||
)
|
||||
++ [ value textOptions.text
|
||||
, Internal.Attr (Html.Events.onInput textOptions.onChange)
|
||||
, hiddenLabelAttribute textOptions.label
|
||||
, spellcheck textInput.spellchecked
|
||||
, Maybe.map autofill textInput.autofill
|
||||
|> Maybe.withDefault Internal.NoAttribute
|
||||
]
|
||||
++ redistributed.input
|
||||
)
|
||||
(Internal.Unkeyed [])
|
||||
|
Loading…
Reference in New Issue
Block a user