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

Miso.Native.Element.ScrollView.Event

Description

 
Synopsis

Event

onScroll :: (ScrollEvent -> action) -> Attribute model action Source #

https://lynxjs.org/api/elements/built-in/scroll-view.html#scroll

data Action = HandleScroll ScrollEvent

view :: context -> props -> Model -> View context Action
view _ _ model = scrollView_ [ onScroll HandleScroll ] [ ]

update :: Action -> Effect props Model Action
update (HandleScroll ScrollEvent {..}) =
  io_ (consoleLog "handled scroll event")

onScrollWith :: (ScrollEvent -> DOMRef -> action) -> Attribute model action Source #

Like onScroll, but the handler also receives the target element's DOMRef. Use for main-thread (MTS) handlers that imperatively mutate the element.

onScrollMain :: (ScrollEvent -> action) -> EventHandler model action Source #

Like onScroll, but dispatched on the Lynx main thread (MTS).

Runs imperatively on the MTS (no VDOM diff). Meant to be used with -XStaticPointers.

data Action = HandleScroll ScrollEvent

view_ [ event (static (onScrollMain HandleScroll)) ] [ "some view" ]

onScrollMainWith :: (ScrollEvent -> model -> DOMRef -> action) -> EventHandler model action Source #

Like onScrollMain, but the handler also receives read-only access to the model and the target element's DOMRef (for imperative MTS mutation).

data Action = HandleScroll ScrollEvent Model DOMRef

view_ [ event (static (onScrollMainWith HandleScroll)) ] [ "some view" ]

onScrollToUpper :: (ScrollEvent -> action) -> Attribute model action Source #

https://lynxjs.org/api/elements/built-in/scroll-view.html#scrolltoupper

data Action = HandleScroll ScrollEvent

view :: context -> props -> Model -> View context Action
view _ _ model = scrollView_ [ onScrollToUpper HnadleScroll ] [ ]

update :: Action -> Effect props Model Action
update (HandleScroll ScrollEvent {..}) =
  io_ (consoleLog "handled scroll event")

onScrollToUpperWith :: (ScrollEvent -> DOMRef -> action) -> Attribute model action Source #

Like onScrollToUpper, but the handler also receives the target element's DOMRef. Use for main-thread (MTS) handlers that imperatively mutate the element.

onScrollToUpperMain :: (ScrollEvent -> action) -> EventHandler model action Source #

Like onScrollToUpper, but dispatched on the Lynx main thread (MTS).

Runs imperatively on the MTS (no VDOM diff). Meant to be used with -XStaticPointers.

data Action = HandleScroll ScrollEvent

view_ [ event (static (onScrollToUpperMain HandleScroll)) ] [ "some view" ]

onScrollToUpperMainWith :: (ScrollEvent -> model -> DOMRef -> action) -> EventHandler model action Source #

Like onScrollToUpperMain, but the handler also receives read-only access to the model and the target element's DOMRef (for imperative MTS mutation).

data Action = HandleScroll ScrollEvent Model DOMRef

view_ [ event (static (onScrollToUpperMainWith HandleScroll)) ] [ "some view" ]

onScrollToLower :: (ScrollEvent -> action) -> Attribute model action Source #

https://lynxjs.org/api/elements/built-in/scroll-view.html#scrolltolower

data Action = HandleScroll ScrollEvent

view :: context -> props -> Model -> View context Action
view _ _ model = scrollView_ [ onScrollToLower HandleScroll ] [ ]

update :: Action -> Effect props Model Action
update (HandleScroll ScrollEvent {..}) =
  io_ (consoleLog "handled scroll event")

onScrollToLowerWith :: (ScrollEvent -> DOMRef -> action) -> Attribute model action Source #

Like onScrollToLower, but the handler also receives the target element's DOMRef. Use for main-thread (MTS) handlers that imperatively mutate the element.

onScrollToLowerMain :: (ScrollEvent -> action) -> EventHandler model action Source #

Like onScrollToLower, but dispatched on the Lynx main thread (MTS).

Runs imperatively on the MTS (no VDOM diff). Meant to be used with -XStaticPointers.

data Action = HandleScroll ScrollEvent

view_ [ event (static (onScrollToLowerMain HandleScroll)) ] [ "some view" ]

onScrollToLowerMainWith :: (ScrollEvent -> model -> DOMRef -> action) -> EventHandler model action Source #

Like onScrollToLowerMain, but the handler also receives read-only access to the model and the target element's DOMRef (for imperative MTS mutation).

data Action = HandleScroll ScrollEvent Model DOMRef

view_ [ event (static (onScrollToLowerMainWith HandleScroll)) ] [ "some view" ]

onScrollEnd :: (ScrollEvent -> action) -> Attribute model action Source #

https://lynxjs.org/api/elements/built-in/scroll-view.html#scrollend

data Action = HandleScroll ScrollEvent

view :: context -> props -> Model -> View context Action
view _ _ model = scrollView_ [ onScrollToLower HandleScroll ] [ ]

update :: Action -> Effect props Model Action
update (HandleScroll ScrollEvent {..}) =
  io_ (consoleLog "handled scroll event")

onScrollEndWith :: (ScrollEvent -> DOMRef -> action) -> Attribute model action Source #

Like onScrollEnd, but the handler also receives the target element's DOMRef. Use for main-thread (MTS) handlers that imperatively mutate the element.

onScrollEndMain :: (ScrollEvent -> action) -> EventHandler model action Source #

Like onScrollEnd, but dispatched on the Lynx main thread (MTS).

Runs imperatively on the MTS (no VDOM diff). Meant to be used with -XStaticPointers.

data Action = HandleScroll ScrollEvent

view_ [ event (static (onScrollEndMain HandleScroll)) ] [ "some view" ]

onScrollEndMainWith :: (ScrollEvent -> model -> DOMRef -> action) -> EventHandler model action Source #

Like onScrollEndMain, but the handler also receives read-only access to the model and the target element's DOMRef (for imperative MTS mutation).

data Action = HandleScroll ScrollEvent Model DOMRef

view_ [ event (static (onScrollEndMainWith HandleScroll)) ] [ "some view" ]

onContentSizeChanged :: (ScrollEvent -> action) -> Attribute model action Source #

https://lynxjs.org/api/elements/built-in/scroll-view.html#contentsizechanged

Triggered when the content area comprised of direct child nodes changes in width or height. This event triggers after the <scroll-view> content completes layout. If updating <scroll-view> child nodes, call updated scrolling methods like scrollTo in this event.

data Action = HandleContentSizeChanged ScrollEvent

view :: context -> props -> Model -> View context Action
view _ _ model = scrollView_ [ onContentSizeChanged HandleContentSizeChanged ] [ ]

update :: Action -> Effect props Model Action
update (HandleContentSizeChanged ScrollEvent {..}) =
  io_ (consoleLog "handled content size changed event")

onContentSizeChangedWith :: (ScrollEvent -> DOMRef -> action) -> Attribute model action Source #

Like onContentSizeChanged, but the handler also receives the target element's DOMRef. Use for main-thread (MTS) handlers that imperatively mutate the element.

onContentSizeChangedMain :: (ScrollEvent -> action) -> EventHandler model action Source #

Like onContentSizeChanged, but dispatched on the Lynx main thread (MTS).

Runs imperatively on the MTS (no VDOM diff). Meant to be used with -XStaticPointers.

data Action = HandleContentSizeChanged ScrollEvent

view_ [ event (static (onContentSizeChangedMain HandleContentSizeChanged)) ] [ "some view" ]

onContentSizeChangedMainWith :: (ScrollEvent -> model -> DOMRef -> action) -> EventHandler model action Source #

Like onContentSizeChangedMain, but the handler also receives read-only access to the model and the target element's DOMRef (for imperative MTS mutation).

data Action = HandleContentSizeChanged ScrollEvent Model DOMRef

view_ [ event (static (onContentSizeChangedMainWith HandleContentSizeChanged)) ] [ "some view" ]

Decoders

Types

Event Map