Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SelectButton: the multiple and allowempty combo should make it possible to deselect values as long as at least 1 remains. #4731

Open
oliviermattei opened this issue Nov 1, 2023 · 4 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@oliviermattei
Copy link

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)

@oliviermattei oliviermattei added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 1, 2023
@oliviermattei
Copy link
Author

Is there any documentation to fork and install primevue locally?

After installing the packages and nuxt dev, I'm getting errors and must have missed a step.

@FlipWarthog
Copy link
Contributor

Is there any documentation to fork and install primevue locally?

After installing the packages and nuxt dev, I'm getting errors and must have missed a step.

Can you start a discussion for this here: https://github.com/orgs/primefaces/discussions ? I've got it working locally so I might be able to help if you can include the errors you're getting.

@nicoroy2561
Copy link

I am encountering this issue as well. Definitely not expected.

@SamuelWei
Copy link

I was also very surprised that if multiple and allowEmpty are both true, you can only select more items but never deselect them.
My expectation would be that you have to select at least one item.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

4 participants