Primitives / foldkit-primitives/dom

KeepScrollOptions

interface · packages/primitives/src/dom/scroll.ts:44

interface KeepScrollOptions {
  readonly storageKey?: string | undefined
  readonly kept?: number | undefined
  readonly patience?: number | undefined
  readonly scroller?: (() => Element | null) | undefined
}

How keepScroll remembers and restores each history entry's offset.

Members

KeepScrollOptions.storageKey

property · packages/primitives/src/dom/scroll.ts:46

readonly storageKey?: string | undefined

The sessionStorage key holding entry offsets. Default 'foldkit:scroll'.

KeepScrollOptions.kept

property · packages/primitives/src/dom/scroll.ts:48

readonly kept?: number | undefined

Entries remembered at most: the oldest are forgotten first. Default 50.

KeepScrollOptions.patience

property · packages/primitives/src/dom/scroll.ts:54

readonly patience?: number | undefined

The longest a restore holds its place while the next screen settles, in milliseconds: the hold ends sooner, once the page is at the offset and its height has stood still for two frames. Default 10000.

KeepScrollOptions.scroller

property · packages/primitives/src/dom/scroll.ts:59

readonly scroller?: (() => Element | null) | undefined

The element that scrolls in place of the window, looked up each time it is read (null while it is not drawn). Default: the window.