blockScrollStrategy
Commons
stable
Prevent page scrolling while an overlay is open. Adds the origam-overlay--scroll-blocked class to all scroll parents, captures their current scroll positions as CSS custom properties, and restores everything on scope disposal.
API
Signature
Full TypeScript signature sourced from the util file.
API
Parameters
Input parameters accepted by this util.
- datarequiredIScrollStrategyData
- Context object carrying reactive refs for the overlay root, target element, and content element, plus an updateLocation callback.
- propsrequiredIScrollStrategyProps
- Strategy configuration, notably the contained flag that restricts scroll-parent collection to within the offset parent rather than the full ancestor chain.
API
Return value
The value returned by this util.
- No return value. Cleanup (restoring scroll positions and removing classes) runs automatically on onScopeDispose.
Usage
Examples
Ready-to-paste usage snippets.
Use inside an overlay composable