SelectButton: the multiple and allowempty combo should make it possible to deselect values as long as at least 1 remains. #4731
Labels
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Describe the bug
Currently, with allowEmpty = false, if an option is selected, it cannot be deselected.
The allowEmpty property seems to imply that the component must not have an empty value, i.e. at least 1 option must be selected.
This would allow the user to correct his selection if he makes a mistake, without having to refresh the page.
Reproducer
https://stackblitz.com/edit/ea9fy2?file=src%2FApp.vue
PrimeVue version
3.38.1
Vue version
3.x
Language
TypeScript
Build / Runtime
Vite
Browser(s)
No response
Steps to reproduce the behavior
SelectButton with 3 options: (X => selected, 0 => unselected)
1: 0 0 0
2: 0 X 0 (X not deselectable)
3: X X 0 (both X not deselectable)
4: X X X (all X not deselectable)
Expected behavior
SelectButton with 3 options: (X => selected, 0 => unselected)
1: 0 0 0
2: 0 X 0 (X not deselectable)
3: X X 0 (one of the two X is deselectable)
4: X 0 0 (X not deselectable)
5: X X X (two X is deselectable)
The text was updated successfully, but these errors were encountered: