connectedLocationStrategy
Commons
stable
Positions a floating overlay relative to its activator by computing the preferred anchor and origin, then adjusting to avoid viewport overflow. Handles both fixed and scrolled activators.
API
Signature
Full TypeScript signature sourced from the util file.
API
Parameters
Input parameters accepted by this util.
- datarequiredILocationStrategyData
- Runtime data provided by the overlay (target ref, content ref, root ref, scroll parent).
- propsrequiredILocationStrategyProps
- Component props driving the strategy: location, origin, offset, strategy.
- contentStylesrequiredRef<Record<string, string>>
- A reactive ref that the strategy mutates to update the overlay's position styles.
API
Return value
The value returned by this util.
- Returns nothing. Applies position styles reactively via the contentStyles ref and sets up resize/scroll watchers.
Usage
Examples
Ready-to-paste usage snippets.
Used via the locationStrategy prop