createBaseSelectSearchInput
Bind a custom text input to BaseSelect with accessible keyboard and IME behavior.
createBaseSelectSearchInput connects an <input> you own to a BaseSelect. Call BaseSelect.useContext() inside a BaseSelect child and pass that state to the hook. The hook returns the input attributes, keyboard handling, focus registration, and IME-safe query commits.
Import#
Options and result#
Pass a Solid signal as searchValue and its setter as setSearchValue, or provide equivalent functions. setSearchValue must return the text it applies. Spread inputProps on an <input>. isComposing reports an active IME composition, so a custom control can defer its own keyboard work. discardComposition drops the composition draft, for example before clearing the selection.
enableddefaults totrue. When it isfalse, the input is read-only and BaseSelect handles keys as it does for a non-editable control.displayValuedefaults tosearchValue. A Combobox can supply the selected label while the list is closed.transformInputruns on each committed input beforesetSearchValue.maxLengthsets the native input attribute. Clamp the value in your setter too when programmatic updates must obey the same limit.autocompletedefaults to'off'.
A non-empty committed query opens the list. During IME composition, the input shows the draft and commits it when the composition ends.