Closed sharknoon closed 1 hour ago
This is by design at the request of people who want to give users the ability to deselect items and set the select's value to the default.
I'll add a prop to bits-ui
to enable you to disable this functionality though! https://github.com/huntabyte/bits-ui/issues/818
Closed as added in bits-ui@next.29
via the allowDeselect
prop on the Select.Root
component 😃
What a quick response! Thank you so much @huntabyte! :)
Describe the bug
In a Select component dropdown, when clicking on an already selected item (which has the checkmark next to the text), it deselects it. In the react shadcn/ui as well as in the Svelte 4 version, you can't deselect an already selected item by clicking again on it.
Reproduction
Expected behavior
React version
https://ui.shadcn.com/docs/components/select
Svelte 4 version
https://www.shadcn-svelte.com/docs/components/select
Wrong behavior
Svelte 5 version
https://next.shadcn-svelte.com/docs/components/select
Logs
System Info
Severity
annoyance