| 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.Method
Contents
Description
Since: 1.13.0.0
Synopsis
- scrollTo :: MisoString -> ScrollTo -> (JSVal -> action) -> (MisoString -> action) -> Effect context props model action
- autoScroll :: MisoString -> AutoScroll -> (JSVal -> action) -> (MisoString -> action) -> Effect context props model action
- scrollIntoView :: MisoString -> ScrollIntoView -> (JSVal -> action) -> (MisoString -> action) -> Effect context props model action
- scrollBy :: MisoString -> ScrollBy -> (JSVal -> action) -> (MisoString -> action) -> Effect context props model action
- getScrollInfo :: MisoString -> (ScrollInfo -> action) -> (MisoString -> action) -> Effect context props model action
- data ScrollTo = ScrollTo {}
- data AutoScroll = AutoScroll {}
- data ScrollIntoView = ScrollIntoView {}
- newtype ScrollBy = ScrollBy {}
- data ScrollInfo = ScrollInfo {}
- defaultScrollTo :: ScrollTo
- defaultAutoScroll :: AutoScroll
- defaultScrollIntoView :: ScrollIntoView
- defaultScrollBy :: ScrollBy
Methods
scrollTo :: MisoString -> ScrollTo -> (JSVal -> action) -> (MisoString -> action) -> Effect context props model action Source #
Invokes the Lynx scrollTo method on a scroll-view element.
Takes a selector, a ScrollTo of parameters, a success continuation and
an error continuation.
Since: 1.13.0.0
autoScroll :: MisoString -> AutoScroll -> (JSVal -> action) -> (MisoString -> action) -> Effect context props model action Source #
Invokes the Lynx autoScroll method on a scroll-view element.
Takes a selector, a AutoScroll of parameters, a success continuation and
an error continuation.
Since: 1.13.0.0
scrollIntoView :: MisoString -> ScrollIntoView -> (JSVal -> action) -> (MisoString -> action) -> Effect context props model action Source #
Invokes the Lynx scrollIntoView method on a scroll-view element.
Takes a selector, a ScrollIntoView of parameters, a success continuation and
an error continuation.
Since: 1.13.0.0
scrollBy :: MisoString -> ScrollBy -> (JSVal -> action) -> (MisoString -> action) -> Effect context props model action Source #
Invokes the Lynx scrollBy method on a scroll-view element.
Takes a selector, a ScrollBy of parameters, a success continuation and
an error continuation.
Since: 1.13.0.0
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
Parameters for scrollTo: the target index, an extra offset to continue past it,
and whether the movement is animated.
Since: 1.13.0.0
data AutoScroll Source #
Parameters for autoScroll: the scroll rate, whether to start or stop, and
whether to stop automatically at the end.
Since: 1.13.0.0
Constructors
| AutoScroll | |
Instances
| Show AutoScroll Source # | |
Defined in Miso.Native.Element.ScrollView.Method Methods showsPrec :: Int -> AutoScroll -> ShowS # show :: AutoScroll -> String # showList :: [AutoScroll] -> ShowS # | |
| Eq AutoScroll Source # | |
Defined in Miso.Native.Element.ScrollView.Method | |
| ToJSVal AutoScroll Source # | |
Defined in Miso.Native.Element.ScrollView.Method | |
data ScrollIntoView Source #
Parameters for scrollIntoView: where the element should come to rest within the
viewport.
Since: 1.13.0.0
Constructors
| ScrollIntoView | |
Fields
| |
Instances
| Show ScrollIntoView Source # | |
Defined in Miso.Native.Element.ScrollView.Method Methods showsPrec :: Int -> ScrollIntoView -> ShowS # show :: ScrollIntoView -> String # showList :: [ScrollIntoView] -> ShowS # | |
| Eq ScrollIntoView Source # | |
Defined in Miso.Native.Element.ScrollView.Method Methods (==) :: ScrollIntoView -> ScrollIntoView -> Bool # (/=) :: ScrollIntoView -> ScrollIntoView -> Bool # | |
| ToJSVal ScrollIntoView Source # | |
Defined in Miso.Native.Element.ScrollView.Method | |
Parameters for scrollBy: the distance to scroll, relative to the current position.
Since: 1.13.0.0
Constructors
| ScrollBy | |
Fields | |
data ScrollInfo Source #
Result of calling getScrollInfo
Constructors
| ScrollInfo | |
Instances
| Show ScrollInfo Source # | |
Defined in Miso.Native.Element.ScrollView.Method Methods showsPrec :: Int -> ScrollInfo -> ShowS # show :: ScrollInfo -> String # showList :: [ScrollInfo] -> ShowS # | |
| Eq ScrollInfo Source # | |
Defined in Miso.Native.Element.ScrollView.Method | |
| FromJSVal ScrollInfo Source # | |
Defined in Miso.Native.Element.ScrollView.Method Methods fromJSVal :: JSVal -> IO (Maybe ScrollInfo) Source # fromJSValUnchecked :: JSVal -> IO ScrollInfo Source # | |
Smart constructors
defaultScrollTo :: ScrollTo Source #
A ScrollTo with sensible defaults (first index, no offset, animated).
Override only the fields you need.
Since: 1.13.0.0
defaultScrollIntoView :: ScrollIntoView Source #
A ScrollIntoView with sensible defaults (nearest alignment).
Override only the fields you need.
Since: 1.13.0.0