Closed lwheng closed 6 years ago
It appears that is-dirty
is not set
My hack:
Mdl msg_ ->
Material.update Mdl (Debug.log "msg_" msg_) model |> Just
Upd2 str ->
let
newModel = { model | str2 = str }
in
update (Mdl <| Component.TextfieldMsg [2] (Textfield.Input str)) newModel
I added a Debug.log "msg_" msg_
and observed that when I added an Options.onInput
to the Textfield
, the Input
(Textfield
's Msg
) is not triggered. So this hack is to trigger it manually
Ah.. another hack:
Textfield.render Mdl
[ 2 ]
model.mdl
[ Textfield.label "Floating label"
, Textfield.floatingLabel
, Textfield.text_
, Options.onInput Upd2
, Textfield.value model.str2
]
[]
Notice Textfield.value model.str2
. This is probably the better hack I guess
Looks like people are just dealing it with a workaround https://github.com/debois/elm-mdl/issues/333
The link issue/333 didn't work
Updated the URL. Turns out I'm an idiot with markdown
I refer you to the "Labelled textfield, floating label" example for textfields. It seems that when I provide an onInput, the label won't float. Below is a screenshot when I added an
Options.onInput
to the textfield in your demo[Edit] I forgot to mention that it is only after the textfield is out of focus