Text input
input : Options msg -> List (Html.Attribute msg) -> String -> Html msg
Text input element
Example:
type Msg = InputUpdated String | FocusUpdated Bool
Input.Text.input
{ maxLength = 10
, onInput = InputUpdated
, hasFocus = Just FocusUpdated
}
[ class "textInput"
...
]
model.currentValue
{ maxLength : Maybe Basics.Int
, onInput : String -> msg
, hasFocus : Maybe (Basics.Bool -> msg)
, type_ : String
}
Options of the input component.
maxLength
is the maximum number of character allowed in this input. Set to Nothing
for no limit.onInput
is the Msg tagger for the onInput event.hasFocus
is an optional Msg tagger for onFocus/onBlur event.type_
is the type of the HTML input element.defaultOptions : (String -> msg) -> Options msg
Default value for Options
.
onInput
(type: String -> msg
) : The onInput Msg taggerValue:
{ maxLength = Nothing
, onInput = onInput
, hasFocus = Nothing
, type_ = "text"
}