Skip to content

Interface: BubbleMenu ​

Controller returned by createBubbleMenu().

Properties ​

PropertyModifierTypeDescription
referencereadonlyVirtualReferenceWhere the selection is on screen; pass it to your positioning code.

Methods ​

dismiss() ​

ts
dismiss(): void;

Hide until the selection changes; focus goes back to the editor.

Returns ​

void


focusFirst() ​

ts
focusFirst(): void;

Move focus to the first control in the bubble (what the focus shortcut does).

Returns ​

void


getBubbleProps() ​

ts
getBubbleProps(): ElementProps;

Props for the bubble element: id and data-state (open or closed). Escape dismisses it, and mousedown outside form fields is prevented to keep the selection.

Returns ​

ElementProps


getState() ​

ts
getState(): BubbleMenuState;

The current state; the same object until something changes.

Returns ​

BubbleMenuState


subscribe() ​

ts
subscribe(listener): () => void;

Call listener on every state change; returns the unsubscribe function.

Parameters ​

ParameterType
listener() => void

Returns ​

() => void