DOM.Util.TextCursor.Element
- Package
- purescript-textcursor
- Repository
- MonoidMusician/purescript-textcursor
#textCursor Source
textCursor :: forall eff. TextCursorElement -> Eff (dom :: DOM | eff) TextCursorGet the TextCursor from a TextCursorElement.
#setTextCursor Source
setTextCursor :: forall eff. TextCursor -> TextCursorElement -> Eff (dom :: DOM | eff) UnitSet the TextCursor on a TextCursorElement. Calls setValue,
setSelectionStart, and setSelectionEnd.
#modifyTextCursor Source
modifyTextCursor :: forall eff. (TextCursor -> TextCursor) -> TextCursorElement -> Eff (dom :: DOM | eff) UnitModifies the TextCursor on an element through the given endomorphism.
#modifyTextCursorST Source
modifyTextCursorST :: forall s m eff. MonadState s m => MonadEff (dom :: DOM | eff) m => Lens' s TextCursor -> (TextCursor -> TextCursor) -> TextCursorElement -> m UnitModifies the TextCursor on an element as well as setting the result in a
State+Eff monad via a lens. Useful for components processing input events!
#focusTextCursor Source
focusTextCursor :: forall eff. TextCursor -> TextCursorElement -> Eff (dom :: DOM | eff) UnitFocuses an element after setting the TextCursor.
#focusTextCursorById Source
focusTextCursorById :: forall eff. ElementId -> TextCursor -> Eff (dom :: DOM | eff) UnitLooks up an element by id to focus with a TextCursor.
Re-exports from DOM.Util.TextCursor.Element.HTML
#setSelectionStart Source
setSelectionStart :: Setter IntSet the index of the start of the selection.
#setSelectionEnd Source
setSelectionEnd :: Setter IntSet the index of the end of the selection.
#setSelectionDirection Source
setSelectionDirection :: Setter DirectionSet the direction of the selection
#selectionStart Source
selectionStart :: Getter IntGet the index of the start of the selection.
#selectionEnd Source
selectionEnd :: Getter IntGet the index of the end of the selection.
#selectionDirection Source
selectionDirection :: Getter DirectionGet the direction of the selection.
Re-exports from DOM.Util.TextCursor.Element.Type
#TextCursorElement Source
data TextCursorElementA container for the two usable Element types:
HTMLInputElementHTMLTextAreaElement
Note that not all HTMLInputElement nodes are valid, as they must contain
text content. See validate for specifics.
Common operations are defined in TextCursor.Element.HTML.
Constructors
#validate' Source
validate' :: forall eff. F TextCursorElement -> Eff (dom :: DOM | eff) (Maybe TextCursorElement)Convert from a Foreign error computation (type F) to a validated
TextCursorElement.
#validate Source
validate :: forall eff. TextCursorElement -> Eff (dom :: DOM | eff) (Maybe TextCursorElement)Validate a TextCursorElement. Input fields need to have one of the
following types when this is called:
- text (default)
- search
- url
#readEventTarget Source
readEventTarget :: Event -> F TextCursorElementRead a TextCursorElement from the target field of an Event.
#lookupValidateAndDo Source
lookupValidateAndDo :: forall eff. ElementId -> (TextCursorElement -> Eff (dom :: DOM | eff) Unit) -> Eff (dom :: DOM | eff) UnitLook up a TextCursorElement by id and run an action if found.
#lookupAndValidate Source
lookupAndValidate :: forall eff. ElementId -> Eff (dom :: DOM | eff) (Maybe TextCursorElement)Look up a TextCursorElement in the document by id.
#htmlTextCursorElementToHTMLElement Source
htmlTextCursorElementToHTMLElement :: TextCursorElement -> HTMLElementConvert a TextCursorElement to a generic HTMLElement. Useful for
focus.