The items that match, in their own order; or, with a rank, the items it scores, best first. The rank replaces the substring test, so it may match more loosely (a subsequence, say).
Items by group, in the order each group first appears. An item with no group falls under "".
step
(index: number, by: number, count: number, wrap?: boolean): number
Moves an index by by. Stops at the ends, or with wrap goes round. From no index (-1) a forward move lands on the first and a backward move on the last.
stepEnabled
(disabled: readonly boolean[], index: number, by: number, wrap?: boolean): number
step over a row where some entries cannot be chosen. A single step lands on the next enabled entry in that direction (wrapping if asked); a longer step (a page) lands on the enabled entry nearest its target. Returns the current index when there is nowhere to go, and -1 when nothing is enabled.
Typeahead over a list of labels (null for an entry that cannot be chosen). Characters typed within timeout ms of each other make one prefix; the first match from the current entry on wins, wrapping. One letter pressed again and again (or a single letter after a pause) cycles through the entries that start with it. index is -1 when nothing matches.
resultsText
(count: number): string
The words a polite live region says after filtering.
emptyText
(query: string): string
createListbox
(el: HTMLElement, opts?: ListboxOptions): Listbox
listboxFor
(el: Element | null): Listbox | undefined
The controller enhance made for this element, if any.
enhance
(root?: ParentNode): () => void
Attaches to every [data-cap="listbox"] under root not yet marked data-cap-ready. Reads data-mode ("input" is found by the combobox whose aria-controls names this list), data-selection ("single", "multi"), data-wrap, and data-filter (typing in the input filters). Returns a function that detaches them all.