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.List.Method

Description

 
Synopsis

Methods

scrollToPosition :: MisoString -> ScrollToPosition -> (MisoString -> action) -> (MisoString -> action) -> Effect parent model action Source #

https://lynxjs.org/api/elements/built-in/list.html#scrolltoposition

The front end can execute boundingClientRect through the SelectorQuery API.

data Action
  = Success MisoString
  | Failure MisoString
  | GetRect

update :: Action -> Effect parent model Action
update GetRect =
  scrollToPosition defaultscrollToPosition "#box" Success Failure
update (Succes _) =
  consoleLog "Successfuly got position"
update (Failure errorMsg) =
  consoleLog ("Failed to call scrollToPosition: " <> errorMsg)

autoScroll :: MisoString -> AutoScroll -> (MisoString -> action) -> (MisoString -> action) -> Effect parent model action Source #

getVisibleCells :: MisoString -> (MisoString -> action) -> (MisoString -> action) -> Effect parent model action Source #

scrollBy :: MisoString -> ScrollBy -> (Consumed -> action) -> (MisoString -> action) -> Effect parent model action Source #

Types

data ScrollToPosition Source #

Constructors

ScrollToPosition 

Fields

  • position :: Double

    Specifies the index of the node to scroll to, with a range of [0, data source count)

  • offset :: Double

    After applying alignTo alignment, continue scrolling the offset length

  • alignTo :: MisoString

    The position of the target node in the view after scrolling.

  • smooth :: Bool

    Whether there is animation during the scrolling process

data AutoScroll Source #

Constructors

AutoScroll 

Fields

Instances

Instances details
ToJSVal AutoScroll Source # 
Instance details

Defined in Miso.Lynx.Element.List.Method

data ScrollBy Source #

Constructors

ScrollBy 

Instances

Instances details
ToJSVal ScrollBy Source # 
Instance details

Defined in Miso.Lynx.Element.List.Method

Smart constructors