| Copyright | (C) 2016-2025 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.Lynx.Element.ScrollView.Event
Description
Synopsis
- onScroll :: (ScrollEvent -> action) -> Attribute action
- onScrollToUpper :: (ScrollEvent -> action) -> Attribute action
- onScrollToLower :: (ScrollEvent -> action) -> Attribute action
- onScrollEnd :: (ScrollEvent -> action) -> Attribute action
- onContentSizeChanged :: (ScrollEvent -> action) -> Attribute 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 action Source #
https://lynxjs.org/api/elements/built-in/scroll-view.html#scroll
data Action = HandleScroll ScrollEvent
view :: Model -> View Action
view model = scrollView_ [ onScroll HandleScroll ] [ ]
update :: Action -> Effect Model Action
update (HandleScroll ScrollEvent {..}) =
io_ (consoleLog "handled scroll event")
onScrollToUpper :: (ScrollEvent -> action) -> Attribute action Source #
https://lynxjs.org/api/elements/built-in/scroll-view.html#scrolltoupper
data Action = HandleScroll ScrollEvent
view :: Model -> View Action
view model = scrollView_ [ onScrollToUpper HnadleScroll ] [ ]
update :: Action -> Effect Model Action
update (HandleScroll ScrollEvent {..}) =
io_ (consoleLog "handled scroll event")
onScrollToLower :: (ScrollEvent -> action) -> Attribute action Source #
https://lynxjs.org/api/elements/built-in/scroll-view.html#scrolltolower
data Action = HandleScroll ScrollEvent
view :: Model -> View Action
view model = scrollView_ [ onScrollToLower HandleScroll ] [ ]
update :: Action -> Effect Model Action
update (HandleScroll ScrollEvent {..}) =
io_ (consoleLog "handled scroll event")
onScrollEnd :: (ScrollEvent -> action) -> Attribute action Source #
https://lynxjs.org/api/elements/built-in/scroll-view.html#scrollend
data Action = HandleScroll ScrollEvent
view :: Model -> View Action
view model = scrollView_ [ onScrollToLower HandleScroll ] [ ]
update :: Action -> Effect Model Action
update (HandleScroll ScrollEvent {..}) =
io_ (consoleLog "handled scroll event")
onContentSizeChanged :: (ScrollEvent -> action) -> Attribute 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 :: Model -> View Action
view model = scrollView_ [ onContentSizeChanged HandleContentSizeChanged ] [ ]
update :: Action -> Effect Model Action
update (HandleContentSizeChanged ScrollEvent {..}) =
io_ (consoleLog "handled content size changed event")
Decoders
Types
data ScrollEvent Source #
Constructors
| ScrollEvent | |
Fields
| |
Instances
| Show ScrollEvent Source # | |
Defined in Miso.Lynx.Element.ScrollView.Event Methods showsPrec :: Int -> ScrollEvent -> ShowS # show :: ScrollEvent -> String # showList :: [ScrollEvent] -> ShowS # | |
| Eq ScrollEvent Source # | |
Defined in Miso.Lynx.Element.ScrollView.Event | |