| 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
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 #
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 AutoScroll Source #
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 #
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 | |
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 # | |