miso
Copyright(C) 2016-2025 David M. Johnson
LicenseBSD3-style (see the file LICENSE)
MaintainerDavid M. Johnson <code@dmj.io>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Miso.Html.Event

Description

 
Synopsis

Mouse

onClickWith :: (DOMRef -> action) -> Attribute action Source #

https://developer.mozilla.org/en-US/docs/Web/Events/click Like onClick, but passes the DOM reference along (akin to getElementById).

onContextMenuWithOptions :: Options -> action -> Attribute action Source #

https://developer.mozilla.org/en-US/docs/Web/Events/contextmenu

This can be used to disable right-click context menu from appearing

div_ [ onContextMenuWithOptions NoOp defaultOptions { preventDefault = False } ] [ ]

Since: 1.9.0.0

Keyboard

onEnter Source #

Arguments

:: action

The action to call when the keydown *is not* 13 (typically NoOp or Id)

-> action

The action to call when keydown *is* 13.

-> Attribute action 

onEnter

A convenience function for processing the Enter key.

data Action = NoOp | OnEnter

type Model = Int

view :: Model -> View model Action
view entryId = input_ [ onEnter NoOp OnEnter ]

Since: 1.9.0.0

Form

Focus

onBlur :: action -> Attribute action Source #

blur event defined with custom options

https://developer.mozilla.org/en-US/docs/Web/Events/blur

Drag

Drop

Select

Pointer

Media

Touch