You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently there is no way to set the displayed input text of the Combobox. The value prop is expected to be a selectable option, so if I want to set the input to something else, it will result in nothing being displayed for the input text.
Describe the solution you'd like
As there is already a separate onInputChange prop for handling changes to the filter text, it would be good if there was also a prop, something like inputValue which can be used to set the filter text in a controlled manner.
Describe alternatives you've considered
The only other option is to add the text as an option. This may work for most scenarios, but is not always desirable.
Alternatively, a datalist can be used to turn a regular text input into a selectable list similar to a combobox (but much harder to style)
Additional context
The current combobox design seems to be like a filterable selection input.
That is one usecase for a combobox, but it can also be useful as a text input with some default options.
It would be great if Kobalte could support both usecases.
The text was updated successfully, but these errors were encountered:
I'm looking for controllable text input as well. For one of my components, I want to make an Combobox that asynchronously loads options based on the users query, but there's a lot of hidden behavior with the current Combobox implementation that clears the text input on certain interactions or prop changes. The most notable in my case is that the text clears when the options change making it impossible to asynchronously load options based on user input.
Another behavior that affects all my Combobox needs is that the text input clears when making a selection, so the user has to re-apply their filter if they want to add similar items.
Both of these behaviors could easily be implemented by a developer with a controlled input if they wanted, but there's little that can be done with the behavior that's currently baked in. I really like the Combobox component, particularly since virtualization was a major consideration. I just need to be able to control the text field, or be able to turn off all auto-clearing options. (Much preferably the former.)
Is your feature request related to a problem? Please describe.
Currently there is no way to set the displayed input text of the Combobox. The
value
prop is expected to be a selectable option, so if I want to set the input to something else, it will result in nothing being displayed for the input text.Describe the solution you'd like
As there is already a separate
onInputChange
prop for handling changes to the filter text, it would be good if there was also a prop, something likeinputValue
which can be used to set the filter text in a controlled manner.Describe alternatives you've considered
The only other option is to add the text as an option. This may work for most scenarios, but is not always desirable.
Alternatively, a datalist can be used to turn a regular text input into a selectable list similar to a combobox (but much harder to style)
Additional context
The current combobox design seems to be like a filterable selection input.
That is one usecase for a combobox, but it can also be useful as a text input with some default options.
It would be great if Kobalte could support both usecases.
The text was updated successfully, but these errors were encountered: