Can you support unselecting listbox items. #1817
Replies: 4 comments
-
The idea of the listbox is to replicate the behavior of a native select. Which cannot be unselected. |
Beta Was this translation helpful? Give feedback.
-
Seems odd then that the multi select allows for you to select 0->1+ (you can unselect all options) but the single select requires 1 (you cant unselect an option) |
Beta Was this translation helpful? Give feedback.
-
Another way to support this is adding a max selected prop for the multiselect, and setting that to 1 |
Beta Was this translation helpful? Give feedback.
-
So @JesusTheHun if the idea of the listbox is to replicate the behavior of a native select, having this additional empty option
and having the default value as Note that we are correctly having the null / empty value mapped on the HTML for the hidden input And when selecting the created empty option the input with the value doesn't change either (although the other properties of the object are added) |
Beta Was this translation helpful? Give feedback.
-
Once you select a list box item you cannot unselect the list box item you can only change your selection to another item. It would be nice to have the option to click on the currently selected option to unselect it.
Beta Was this translation helpful? Give feedback.
All reactions