Text input
(TEA) Initial model constant
Value: { value = "" , hasFocus = False }
(TEA) View function
Example:
Input.Text.input
{ id = "TextInput"
, maxLength = Just 4
}
[ class "textInput"
...
]
model.textModelOptions of the input component.
* id is the id of the HTML element.
* maxLength is the maximum number of character allowed in this input. Set to Nothing for no limit.
Default value for Options.
Params:
* id (type: String) : The id of the number input element.
Value: { id = id , maxLength = Nothing }
(TEA) Update function
Example:
type Msg = UpdateText Input.Text.Msg
update msg model =
case msg of
UpdateText textMsg ->
{ model | textModel = Input.Text.update textMsg model.textModel }(TEA) Opaque Msg types
(TEA) Model record Fields: *
value: current value of the input element. *hasFocus: flag whether the input element has focus or not.