Selection
| Method | Type | Description |
|---|---|---|
getSelected() | () => T[] | Currently selected option objects. |
setSelected(values, opts?) | (values, { notify? }) => void | Set selected values (pass [] to clear). notify: true fires change. |
getValue() | () => string | number | (…)[] | null | Serialized value per value-format. |
selectedValue | getter | Read-only serialized value. |
selectedItem | getter | First selected option (single-select) or null. |
Dropdown
Imperative open/close added in v2.0.0.
| Method | Type | Description |
|---|---|---|
open() v2.0.0 | () => void | Open the dropdown (flushes pending property writes first). |
close() v2.0.0 | () => void | Close the dropdown. |
toggle() v2.0.0 | () => void | Toggle open/closed. |
isOpen v2.0.0 | getter/setter | Read or assign the open state. |
Search & scroll
The search-text control and scroll-to API are new in v2.0.0.
| Method | Type | Description |
|---|---|---|
searchText v2.0.0 | getter | Current search-box text. |
search(term) v2.0.0 | (term: string) => void | Set the search text and filter as if typed (runs beforeSearch / min-length / async). Does not open the dropdown. |
clearSearch() v2.0.0 | () => void | Clear the search and restore the full list. |
scrollToIndex(i, opts?) v2.0.0 | (i, { block? }) => boolean | Scroll to the option at index in the filtered list. |
scrollToValue(v, opts?) v2.0.0 | (v, { block? }) => boolean | Scroll to the option with this value (false if filtered out / under a collapsed branch). |
scrollToGroup(name, opts?) v2.0.0 | (name, { block? }) => boolean | Scroll to a group header / first group option. |
Messaging & lifecycle
| Method | Type | Description |
|---|---|---|
showMessage(content, opts?) v2.0.0 | (content, { variant?, duration?, placement? }) => void | Show a transient toast (visible even in the fullscreen overlay). |
hideMessage() v2.0.0 | () => void | Dismiss the transient message. |
destroy() | () => void | Clean up (called automatically on disconnect). |
Example
Imperative usage