miso-lynx
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.Lynx.Element.ScrollView.Event

Description

 
Synopsis

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

Event Map