Module

Bonsai.DOM

Package
purescript-bonsai
Repository
grmble/purescript-bonsai

Bonsai DOM Helpers

#domElementById Source

domElementById :: forall eff. ElementId -> Eff (dom :: DOM | eff) (Maybe Element)

Gets a DOM Element by its ID

#domRequestAnimationFrame Source

domRequestAnimationFrame :: forall eff. Eff (dom :: DOM | eff) Unit -> Eff (dom :: DOM | eff) RequestAnimationFrameId

Request animation frame

#focusCmd Source

focusCmd :: forall msg eff. ElementId -> Cmd (dom :: DOM | eff) msg

Cmd that will set the focus to the input field.

#focusSelectCmd Source

focusSelectCmd :: forall msg eff. ElementId -> Cmd (dom :: DOM | eff) msg

Cmd that will set the focus and select the input field

#affElementAction Source

affElementAction :: forall a eff. (Element -> Eff (dom :: DOM | eff) a) -> ElementId -> Aff (dom :: DOM | eff) a

Helper for calling effectful actions on dom nodes.

This uses a short delay to let the render happen before trying to find the element.

#affElementById Source

affElementById :: forall eff. ElementId -> Aff (dom :: DOM | eff) Element

Get a DOM element in a Aff context

This represents failure as Aff error