Optionally control Combobox.Input
value
#1139
Replies: 2 comments
-
Forget it, it actually works, as long as you make sure that On the other hand, maybe we could add a warning when user switches uncontrolled Combobox to a controlled one, similarly to what |
Beta Was this translation helpful? Give feedback.
-
@jtomaszewski I think it would make sense to make this as default behavior: clear input when the value is undefined. It just feels natural to me. And in my case I can't set null because I'm using typscript and value accepts only the type inferred from the displayValue prop |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently passing
value
prop toCombobox.Input
in React does nothing. I'd expect that I can optionally control the input value by passingvalue
prop to it.This would let me accomplish two things:
I want to reset the input value to Combobox value when user leaves the input
I want to reset the Combobox value when user clicks a "Reset" button (rendered somewhere next to the combobox)
Example:
@RobinMalfait , would you accept a PR for that?
Beta Was this translation helpful? Give feedback.
All reactions