| 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.Element.ScrollView.Event
Description
Synopsis
- onScroll :: (ScrollEvent -> action) -> Attribute model action
- onScrollWith :: (ScrollEvent -> DOMRef -> action) -> Attribute model action
- onScrollMain :: (ScrollEvent -> action) -> EventHandler model action
- onScrollMainWith :: (ScrollEvent -> model -> DOMRef -> action) -> EventHandler model action
- onScrollToUpper :: (ScrollEvent -> action) -> Attribute model action
- onScrollToUpperWith :: (ScrollEvent -> DOMRef -> action) -> Attribute model action
- onScrollToUpperMain :: (ScrollEvent -> action) -> EventHandler model action
- onScrollToUpperMainWith :: (ScrollEvent -> model -> DOMRef -> action) -> EventHandler model action
- onScrollToLower :: (ScrollEvent -> action) -> Attribute model action
- onScrollToLowerWith :: (ScrollEvent -> DOMRef -> action) -> Attribute model action
- onScrollToLowerMain :: (ScrollEvent -> action) -> EventHandler model action
- onScrollToLowerMainWith :: (ScrollEvent -> model -> DOMRef -> action) -> EventHandler model action
- onScrollEnd :: (ScrollEvent -> action) -> Attribute model action
- onScrollEndWith :: (ScrollEvent -> DOMRef -> action) -> Attribute model action
- onScrollEndMain :: (ScrollEvent -> action) -> EventHandler model action
- onScrollEndMainWith :: (ScrollEvent -> model -> DOMRef -> action) -> EventHandler model action
- onContentSizeChanged :: (ScrollEvent -> action) -> Attribute model action
- onContentSizeChangedWith :: (ScrollEvent -> DOMRef -> action) -> Attribute model action
- onContentSizeChangedMain :: (ScrollEvent -> action) -> EventHandler model action
- onContentSizeChangedMainWith :: (ScrollEvent -> model -> DOMRef -> action) -> EventHandler model action
- scrollDecoder :: Decoder ScrollEvent
- data ScrollEvent = ScrollEvent {
- scrollType :: MisoString
- deltaX :: Double
- deltaY :: Double
- scrollLeft :: Double
- scrollTop :: Double
- scrollHeight :: Double
- scrollWidth :: Double
- scrollViewEvents :: Events
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 #
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
data ScrollEvent Source #
Constructors
| ScrollEvent | |
Fields
| |
Instances
| Show ScrollEvent Source # | |
Defined in Miso.Native.Element.ScrollView.Event Methods showsPrec :: Int -> ScrollEvent -> ShowS # show :: ScrollEvent -> String # showList :: [ScrollEvent] -> ShowS # | |
| Eq ScrollEvent Source # | |
Defined in Miso.Native.Element.ScrollView.Event | |