Interface: UseSuggestionMenuResult
Returned by useSuggestionMenu().
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
reference | readonly | VirtualReference | Where the trigger character is; give it to your positioning code. |
state | readonly | Readonly<ShallowRef<SuggestionMenuState>> | The controller state as a shallow ref; updated on the client while the scope is alive. |
Methods
dismiss()
ts
dismiss(): void;Close until the user types somewhere else.
Returns
void
getListboxProps()
ts
getListboxProps(): VueProps;Props for the list: id, role="listbox", aria-label. Mousedown is prevented to keep focus in the editor.
Returns
getOptionProps()
ts
getOptionProps(id): VueProps;Props for an option: id, role="option", aria-selected, data-active when highlighted. Click chooses it.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
getStatusProps()
ts
getStatusProps(): VueProps;A polite live region announcing how many options there are.
Returns
select()
ts
select(id): void;Remove the typed trigger and query, run the item's command in the same undo step, and focus the editor. Does nothing for an unknown id or while closed.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
void