Number input
Options of the input component.
maxLength is the maximum number of character allowed in this input. Set to Nothing for no limit.maxValue is the maximum number value allowed in this input. Set to Nothing for no limit.minValue is the minimum number value 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.Default options for input with String value
Params:
onInput (type: String -> msg) : The onInput Msg taggerValue:
{ onInput = onInput
, maxValue = Nothing
, minValue = Nothing
, hasFocus = Nothing
}Default value for Options.
Params:
onInput (type: Maybe Float -> msg) : The onInput Msg taggerValue:
{ onInput = onInput
, maxValue = Nothing
, minValue = Nothing
, hasFocus = Nothing
}View function
Example:
type alias Model = { currentValue : Maybe Float }
type Msg = InputUpdated (Maybe Float) | FocusUpdated Bool
Input.Number.input
{ onInput = InputUpdated
, maxValue = 1000
, minValue = 10
, hasFocus = Just FocusUpdated
}
[ class "numberInput"
...
]
model.currentValueView function for input with String value
Example:
type alias Model = { currentValue : String }
type Msg = InputUpdated String | FocusUpdated Bool
Input.Number.inputString
{ onInput = InputUpdated
, maxValue = 1000
, minValue = 10
, hasFocus = Just FocusUpdated
}
[ class "numberInput"
...
]
model.currentValue
Options of the input component with
Stringvalue.maxLengthis the maximum number of character allowed in this input. Set toNothingfor no limit.maxValueis the maximum number value allowed in this input. Set toNothingfor no limit.minValueis the minimum number value allowed in this input. Set toNothingfor no limit.onInputis the Msg tagger for the onInput event.hasFocusis an optional Msg tagger for onFocus/onBlur event.