getTargetActivator

Commons
stable

Resolves an activator selector to the concrete HTMLElement that should act as the trigger for an overlay (Menu, Tooltip, …). Accepts the special value "parent" to walk up the DOM and skip data-no-activator nodes.

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

selector
required
T
The activator descriptor. "parent" walks up to the nearest parent that is not marked data-no-activator. A CSS string is queried via querySelector. An [x, y] tuple is passed through for cursor-position overlays.
vm
required
ComponentInternalInstance
The calling component instance, used as the starting point when selector is "parent".

API

Return value

The value returned by this util.

The resolved HTMLElement, an [x, y] coordinate tuple for cursor overlays, or undefined when the selector is falsy or no matching element is found.

Usage

Examples

Ready-to-paste usage snippets.

Resolve the parent activator

typescript