| Copyright | (C) 2016-2026 David M. Johnson |
|---|---|
| License | BSD3-style (see the file LICENSE) |
| Maintainer | David M. Johnson <code@dmj.io> |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Miso.Native.X.Element.Input.Event
Description
Synopsis
- onBlur :: (MisoString -> action) -> Attribute model action
- onBlurWith :: (MisoString -> DOMRef -> action) -> Attribute model action
- onBlurMain :: (MisoString -> action) -> EventHandler model action
- onBlurMainWith :: (MisoString -> model -> DOMRef -> action) -> EventHandler model action
- onConfirm :: (MisoString -> action) -> Attribute model action
- onConfirmWith :: (MisoString -> DOMRef -> action) -> Attribute model action
- onConfirmMain :: (MisoString -> action) -> EventHandler model action
- onConfirmMainWith :: (MisoString -> model -> DOMRef -> action) -> EventHandler model action
- onFocus :: (MisoString -> action) -> Attribute model action
- onFocusWith :: (MisoString -> DOMRef -> action) -> Attribute model action
- onFocusMain :: (MisoString -> action) -> EventHandler model action
- onFocusMainWith :: (MisoString -> model -> DOMRef -> action) -> EventHandler model action
- onInput :: (InputEvent -> action) -> Attribute model action
- onInputWith :: (InputEvent -> DOMRef -> action) -> Attribute model action
- onInputMain :: (InputEvent -> action) -> EventHandler model action
- onInputMainWith :: (InputEvent -> model -> DOMRef -> action) -> EventHandler model action
- onSelection :: (SelectionEvent -> action) -> Attribute model action
- onSelectionWith :: (SelectionEvent -> DOMRef -> action) -> Attribute model action
- onSelectionMain :: (SelectionEvent -> action) -> EventHandler model action
- onSelectionMainWith :: (SelectionEvent -> model -> DOMRef -> action) -> EventHandler model action
- data InputEvent = InputEvent {}
- data SelectionEvent = SelectionEvent {}
- inputValueDecoder :: Decoder MisoString
- inputDecoder :: Decoder InputEvent
- selectionDecoder :: Decoder SelectionEvent
- inputEvents :: Events
Events
onBlur :: (MisoString -> action) -> Attribute model action Source #
https://lynxjs.org/api/elements/built-in/input.html#bindblur
Triggered when the input is blurred, outputting the current value.
onBlurWith :: (MisoString -> DOMRef -> action) -> Attribute model action Source #
onBlurMain :: (MisoString -> action) -> EventHandler model action Source #
Like onBlur, but dispatched on the Lynx main thread (MTS).
Runs imperatively on the MTS (no VDOM diff). Meant to be used with
-XStaticPointers.
data Action = Blurred MisoString view_ [ event (static (onBlurMain Blurred)) ] [ "some view" ]
onBlurMainWith :: (MisoString -> model -> DOMRef -> action) -> EventHandler model action Source #
Like onBlurMain, but the handler also receives read-only access to the
model and the target element's DOMRef (for imperative MTS mutation).
data Action = Blurred MisoString Model DOMRef view_ [ event (static (onBlurMainWith Blurred)) ] [ "some view" ]
onConfirm :: (MisoString -> action) -> Attribute model action Source #
https://lynxjs.org/api/elements/built-in/input.html#bindconfirm
Triggered when the confirm button is clicked, outputting the current value.
onConfirmWith :: (MisoString -> DOMRef -> action) -> Attribute model action Source #
onConfirmMain :: (MisoString -> action) -> EventHandler model action Source #
Like onConfirm, but dispatched on the Lynx main thread (MTS).
Runs imperatively on the MTS (no VDOM diff). Meant to be used with
-XStaticPointers.
data Action = Confirmed MisoString view_ [ event (static (onConfirmMain Confirmed)) ] [ "some view" ]
onConfirmMainWith :: (MisoString -> model -> DOMRef -> action) -> EventHandler model action Source #
Like onConfirmMain, but the handler also receives read-only access to the
model and the target element's DOMRef (for imperative MTS mutation).
data Action = Confirmed MisoString Model DOMRef view_ [ event (static (onConfirmMainWith Confirmed)) ] [ "some view" ]
onFocus :: (MisoString -> action) -> Attribute model action Source #
https://lynxjs.org/api/elements/built-in/input.html#bindfocus
Triggered when the input is focused, outputting the current value.
onFocusWith :: (MisoString -> DOMRef -> action) -> Attribute model action Source #
onFocusMain :: (MisoString -> action) -> EventHandler model action Source #
Like onFocus, but dispatched on the Lynx main thread (MTS).
Runs imperatively on the MTS (no VDOM diff). Meant to be used with
-XStaticPointers.
data Action = Focused MisoString view_ [ event (static (onFocusMain Focused)) ] [ "some view" ]
onFocusMainWith :: (MisoString -> model -> DOMRef -> action) -> EventHandler model action Source #
Like onFocusMain, but the handler also receives read-only access to the
model and the target element's DOMRef (for imperative MTS mutation).
data Action = Focused MisoString Model DOMRef view_ [ event (static (onFocusMainWith Focused)) ] [ "some view" ]
onInput :: (InputEvent -> action) -> Attribute model action Source #
https://lynxjs.org/api/elements/built-in/input.html#bindinput
Triggered when the input content changes.
onInputWith :: (InputEvent -> DOMRef -> action) -> Attribute model action Source #
onInputMain :: (InputEvent -> action) -> EventHandler model action Source #
Like onInput, but dispatched on the Lynx main thread (MTS).
Runs imperatively on the MTS (no VDOM diff). Meant to be used with
-XStaticPointers.
data Action = Changed InputEvent view_ [ event (static (onInputMain Changed)) ] [ "some view" ]
onInputMainWith :: (InputEvent -> model -> DOMRef -> action) -> EventHandler model action Source #
Like onInputMain, but the handler also receives read-only access to the
model and the target element's DOMRef (for imperative MTS mutation).
data Action = Changed InputEvent Model DOMRef view_ [ event (static (onInputMainWith Changed)) ] [ "some view" ]
onSelection :: (SelectionEvent -> action) -> Attribute model action Source #
https://lynxjs.org/api/elements/built-in/input.html#bindselection
Triggered when the input selection changes.
onSelectionWith :: (SelectionEvent -> DOMRef -> action) -> Attribute model action Source #
Like onSelection, but the handler also receives the target element's DOMRef.
Use for main-thread (MTS) handlers that imperatively mutate the element.
onSelectionMain :: (SelectionEvent -> action) -> EventHandler model action Source #
Like onSelection, but dispatched on the Lynx main thread (MTS).
Runs imperatively on the MTS (no VDOM diff). Meant to be used with
-XStaticPointers.
data Action = Selected SelectionEvent view_ [ event (static (onSelectionMain Selected)) ] [ "some view" ]
onSelectionMainWith :: (SelectionEvent -> model -> DOMRef -> action) -> EventHandler model action Source #
Like onSelectionMain, but the handler also receives read-only access to
the model and the target element's DOMRef (for imperative MTS mutation).
data Action = Selected SelectionEvent Model DOMRef view_ [ event (static (onSelectionMainWith Selected)) ] [ "some view" ]
Types
data InputEvent Source #
Payload of the bindinput event.
Constructors
| InputEvent | |
Fields
| |
Instances
| Show InputEvent Source # | |
Defined in Miso.Native.X.Element.Input.Event Methods showsPrec :: Int -> InputEvent -> ShowS # show :: InputEvent -> String # showList :: [InputEvent] -> ShowS # | |
| Eq InputEvent Source # | |
Defined in Miso.Native.X.Element.Input.Event | |
data SelectionEvent Source #
Payload of the bindselection event.
Constructors
| SelectionEvent | |
Instances
| Show SelectionEvent Source # | |
Defined in Miso.Native.X.Element.Input.Event Methods showsPrec :: Int -> SelectionEvent -> ShowS # show :: SelectionEvent -> String # showList :: [SelectionEvent] -> ShowS # | |
| Eq SelectionEvent Source # | |
Defined in Miso.Native.X.Element.Input.Event Methods (==) :: SelectionEvent -> SelectionEvent -> Bool # (/=) :: SelectionEvent -> SelectionEvent -> Bool # | |
Decoders
inputValueDecoder :: Decoder MisoString Source #
Decodes the value field shared by bindblur, bindconfirm and bindfocus.
Event Map
inputEvents :: Events Source #