react-datalist-input
react-datalist-input copied to clipboard
Expose hook with current input to user
Problem
I don't think there is currently a way for a user to access the current input value of the input field. The input value would be useful in case one wants to use a custom item component that highlights the matching part of the label string.
Background
You can pass a custom component for each item in the items array as a node
property. The node
property will then be rendered for each item. In that case, you currently do not have access to the current input to do some custom highlighting.
Custom highlighting would require that the module exposes a hook that has access to ComboboxContext
. ComboboxContext
should be extended to also include the current input value. The value can then be exposed via the hook and accessed in the custom item component.
Task
Add current input value to ComboboxContext
and expose ComboboxContext
values through hook to use in custom item component.
- Investigate if there is currently a way to access the input value
- Pass current input value to
ComboboxContext
- Create hook that is exposed to user that returns value (and maybe other useful data)
- Document use case in README