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.
API
Parameters
Input parameters accepted by this util.
- datarequiredIScrollStrategyData
- Runtime context for the scroll strategy: references to the target element, content element, and the updateLocation callback used to reposition the overlay.
- _propsrequiredIScrollStrategyProps
- Component props for the scroll strategy. Not used directly by reposition but required by the shared scroll-strategy interface.
- scoperequiredEffectScope
- 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