repositionScrollStrategy

Commons
stable

Scroll strategy that repositions a floating overlay (menu, tooltip, popover) to track its anchor when the page scrolls. Automatically throttles updates via requestIdleCallback when repositioning is slow.

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

data
required
IScrollStrategyData
Runtime context for the scroll strategy: references to the target element, content element, and the updateLocation callback used to reposition the overlay.
_props
required
IScrollStrategyProps
Component props for the scroll strategy. Not used directly by reposition but required by the shared scroll-strategy interface.
scope
required
EffectScope
Vue EffectScope in which the scroll listener and animation-frame cleanup are registered. The strategy is automatically torn down when the scope stops.

API

Return value

The value returned by this util.

No return value. The strategy wires up and tears down scroll listeners reactively within the provided EffectScope.

Usage

Examples

Ready-to-paste usage snippets.

Attach to an overlay via the scrollStrategy prop

html