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.

typescript

API

Parameters

Input parameters accepted by this util.

data
required
ILocationStrategyData
Runtime data provided by the overlay (target ref, content ref, root ref, scroll parent).
props
required
ILocationStrategyProps
Component props driving the strategy: location, origin, offset, strategy.
contentStyles
required
Ref<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

html