IScrollStrategyData

interface
Scroll

Runtime data bag passed to every TScrollStrategyFn. Gives the strategy access to the overlay root element, content element, positioning target, active state flag and the update-location callback to recompute floating position.

TypeScript

Definition

The TypeScript interface definition as found in the origam source. Click the copy icon to copy the snippet.

typescript

API

Properties

Every property declared by this interface, with its type, optionality and default.

root
required
Ref<HTMLElement | undefined>
The overlay root element whose scroll listeners are managed by the strategy.
contentEl
required
Ref<HTMLElement | undefined>
The floating content element (tooltip bubble, menu panel, …).
targetEl
required
Ref<HTMLElement | undefined>
The anchor / activator element that the floating panel is positioned relative to.
isActive
required
Ref<boolean>
Reactive flag controlling overlay visibility. Strategies may set this to false to close the overlay on scroll.
updateLocation
required
Ref<((e: Event) => void) | undefined>
Callback provided by the positioning engine. The strategy calls it on scroll events to recompute the floating panel position.

Ecosystem

Used by

Components and composables that extend or consume this interface.

Usage

Examples

Ready-to-paste code snippets using this interface.

Writing a custom TScrollStrategyFn

typescript