useTypeaheadSearch
Manages typeahead search by accumulating key presses with an auto-reset timer.
Accumulates individual key presses into a search string with an auto-reset timer. Used internally by Menu and SelectMenu for keyboard-driven search.
Import#
import { useTypeaheadSearch } from '@volue/wave-react';
Example#
API Reference#
Arguments#
Prop | Type | Default |
|---|---|---|
onSearchChange* | (search: string) => void | — |
Returns#
[searchRef: RefObject<string>, handleTypeaheadSearch: (key: string) => void, resetTypeahead: () => void] — A tuple with a ref to the current search string, a handler to call with each key press, and a reset function.