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

Description

 
Synopsis

Methods

scrollTo :: MisoString -> ScrollTo -> (JSVal -> action) -> (MisoString -> action) -> Effect context props model action Source #

autoScroll :: MisoString -> AutoScroll -> (JSVal -> action) -> (MisoString -> action) -> Effect context props model action Source #

scrollIntoView :: MisoString -> ScrollIntoView -> (JSVal -> action) -> (MisoString -> action) -> Effect context props model action Source #

scrollBy :: MisoString -> ScrollBy -> (JSVal -> action) -> (MisoString -> action) -> Effect context props model action Source #

getScrollInfo :: MisoString -> (ScrollInfo -> action) -> (MisoString -> action) -> Effect context props model action Source #

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

Retrieves the current scroll information of the <scroll-view>.

data Action = GetInfo | InfoReceived ScrollInfo | GotError MisoString

update :: Action -> Effect props model Action
update = \case
  GetInfo -> getScrollInfo "#box" InfoReceived GotError
  InfoReceived ScrollInfo {..} -> io_ (consoleLog "got scroll info")
  GotError errMsg -> io_ (consoleLog errMsg)

Types

data ScrollTo Source #

Constructors

ScrollTo 

Fields

Instances

Instances details
Show ScrollTo Source # 
Instance details

Defined in Miso.Native.Element.ScrollView.Method

Eq ScrollTo Source # 
Instance details

Defined in Miso.Native.Element.ScrollView.Method

ToJSVal ScrollTo Source # 
Instance details

Defined in Miso.Native.Element.ScrollView.Method

data AutoScroll Source #

Constructors

AutoScroll 

Fields

data ScrollIntoView Source #

Constructors

ScrollIntoView 

Fields

  • block :: MisoString

    Vertical alignment options: "start" aligns top | "center" centers | "end" aligns bottom

  • inline :: MisoString

    Horizontal alignment options: "start" aligns left | "center" centers | "end" aligns right

  • behavior :: MisoString

    "smooth" | "none" whether to animate scrolling

newtype ScrollBy Source #

Constructors

ScrollBy 

Instances

Instances details
Show ScrollBy Source # 
Instance details

Defined in Miso.Native.Element.ScrollView.Method

Eq ScrollBy Source # 
Instance details

Defined in Miso.Native.Element.ScrollView.Method

ToJSVal ScrollBy Source # 
Instance details

Defined in Miso.Native.Element.ScrollView.Method

data ScrollInfo Source #

Result of calling getScrollInfo

Constructors

ScrollInfo 

Fields

Smart constructors