Additional decoders for use with event handlers in html.
TODO: key
TODO: code
TODO: KeyEvent
, keyEvent
charCode : Json.Decode.Decoder (Maybe Char)
Character code for key board events. This is being deprecated, but support for DOM3 Keyboard events is not yet present in most browsers.
targetValueFloat : Json.Decode.Decoder Basics.Float
Floating-point target value.
targetValueInt : Json.Decode.Decoder Basics.Int
Integer target value.
targetValueMaybe : Json.Decode.Decoder (Maybe String)
String or empty target value.
targetValueMaybeFloat : Json.Decode.Decoder (Maybe Basics.Float)
Floating-point or empty target value.
targetValueMaybeInt : Json.Decode.Decoder (Maybe Basics.Int)
Integer or empty target value.
targetValueFloatParse : Json.Decode.Decoder Basics.Float
Parse a floating-point value from the input instead of using valueAsNumber
.
Use this with inputs that do not have a number
type.
targetValueIntParse : Json.Decode.Decoder Basics.Int
Parse an integer value from the input instead of using valueAsNumber
.
Use this with inputs that do not have a number
type.
targetValueMaybeFloatParse : Json.Decode.Decoder (Maybe Basics.Float)
Parse an optional floating-point value from the input instead of using valueAsNumber
.
Use this with inputs that do not have a number
type.
targetValueMaybeIntParse : Json.Decode.Decoder (Maybe Basics.Int)
Parse an optional integer value from the input instead of using valueAsNumber
.
Use this with inputs that do not have a number
type.
targetSelectedIndex : Json.Decode.Decoder (Maybe Basics.Int)
Parse the index of the selected option of a select. Returns Nothing in place of the spec's magic value -1.
onClickPreventDefault : msg -> Batchable.Html.Attribute msg
Always send msg
upon click, preventing the browser's default behavior.
onClickStopPropagation : msg -> Batchable.Html.Attribute msg
Always send msg
upon click, preventing click propagation.
onClickPreventDefaultAndStopPropagation : msg -> Batchable.Html.Attribute msg
Always send msg
upon click, preventing the browser's default behavior and propagation
onEnter : msg -> Batchable.Html.Attribute msg
When the enter key is released, send the msg
.
Otherwise, do nothing.
onChange : (String -> msg) -> Batchable.Html.Attribute msg
An HTML Event attribute that passes the event.target.value
to a msg
constructor when an input
, select
, or textarea
element has changed.