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

Signature TypeScript complète, extraite du fichier util.

typescript

API

Paramètres

Paramètres d'entrée acceptés par cet util.

data
requis
ILocationStrategyData
Runtime data provided by the overlay (target ref, content ref, root ref, scroll parent).
props
requis
ILocationStrategyProps
Component props driving the strategy: location, origin, offset, strategy.
contentStyles
requis
Ref<Record<string, string>>
A reactive ref that the strategy mutates to update the overlay's position styles.

API

Valeur de retour

La valeur retournée par cet util.

Returns nothing. Applies position styles reactively via the contentStyles ref and sets up resize/scroll watchers.

Usage

Exemples

Extraits de code prêts à coller.

Used via the locationStrategy prop

html