| 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.Method
Description
Synopsis
- focus :: MisoString -> action -> (MisoString -> action) -> Effect context props model action
- blur :: MisoString -> action -> (MisoString -> action) -> Effect context props model action
- setValue :: MisoString -> MisoString -> action -> (MisoString -> action) -> Effect context props model action
- setSelectionRange :: MisoString -> Int -> Int -> action -> (MisoString -> action) -> Effect context props model action
- getValue :: MisoString -> (InputValue -> action) -> (MisoString -> action) -> Effect context props model action
- data InputValue = InputValue {
- value :: MisoString
- selectionStart :: Int
- selectionEnd :: Int
- isComposing :: Bool
Methods
focus :: MisoString -> action -> (MisoString -> action) -> Effect context props model action Source #
https://lynxjs.org/api/elements/built-in/input.html#focus
Requests focus for the selected <input>.
focus "#myInput" Focused FocusFailed
blur :: MisoString -> action -> (MisoString -> action) -> Effect context props model action Source #
https://lynxjs.org/api/elements/built-in/input.html#blur
Releases focus for the selected <input>.
blur "#myInput" Blurred BlurFailed
setValue :: MisoString -> MisoString -> action -> (MisoString -> action) -> Effect context props model action Source #
https://lynxjs.org/api/elements/built-in/input.html#setvalue
Sets the input content of the selected <input>.
setValue "#myInput" "hello" ValueSet ValueSetFailed
setSelectionRange :: MisoString -> Int -> Int -> action -> (MisoString -> action) -> Effect context props model action Source #
https://lynxjs.org/api/elements/built-in/input.html#setselectionrange
Sets the selection range of the selected <input>.
setSelectionRange "#myInput" 0 3 RangeSet RangeSetFailed
getValue :: MisoString -> (InputValue -> action) -> (MisoString -> action) -> Effect context props model action Source #
https://lynxjs.org/api/elements/built-in/input.html#getvalue
Retrieves the current value (and selection) of the selected <input>.
getValue "#myInput" GotValue GetValueFailed
Types
data InputValue Source #
Result of calling getValue.
Constructors
| InputValue | |
Fields
| |
Instances
| Show InputValue Source # | |
Defined in Miso.Native.X.Element.Input.Method Methods showsPrec :: Int -> InputValue -> ShowS # show :: InputValue -> String # showList :: [InputValue] -> ShowS # | |
| Eq InputValue Source # | |
Defined in Miso.Native.X.Element.Input.Method | |
| FromJSVal InputValue Source # | |
Defined in Miso.Native.X.Element.Input.Method Methods fromJSVal :: JSVal -> IO (Maybe InputValue) Source # fromJSValUnchecked :: JSVal -> IO InputValue Source # | |