Documentation

@kanunilabs/datagrid-react


@kanunilabs/datagrid-react / ToolbarSearchOptions

Interface: ToolbarSearchOptions

Properties

applyOnBlur?

optional applyOnBlur?: boolean

Run the search at once when the box loses focus (and on Enter), instead of waiting out the debounce. Default true.


ariaLabel?

optional ariaLabel?: string

The box's accessible name, read by a screen reader. Default: the grid dictionary's search word (toolbarSearch).


debounce?

optional debounce?: number

Milliseconds after the last keystroke before the search runs. Default 200.


maxLength?

optional maxLength?: number

Longest text the box accepts (the input's maxLength).


placeholder?

optional placeholder?: string

Placeholder text. Default: the grid's "Search…" in its language.


validate?

optional validate?: (text) => string | null

Check the text before it is searched. Return a message to show under the box (the text is then NOT sent, and the last valid search stays), or null when the text is fine. Runs on every change.

validate: (text) => /\p{Extended_Pictographic}/u.test(text) ? 'No emoji' : null

Parameters

text

string

Returns

string | null