-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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: Default behavior is broken (and the PrimeNG SelectButton demo is also broke) #13907
Comments
There was introduced new property "allowEmpty" with default value true. It also breaks our app, it should have been false by default I believe, because currently it is unfortunately breaking change . |
Hi, It's not a defect or bug. allowEmpty feature does it. Before allowEmpty, user cannot unselect the button without selecting the other one. It works as it should be but thanks for the video I've fixed a bug in the demo of disabled button example and fixed in here 255fa42 Closing the issue and the PR since it works as it should be, allowEmpty property is set true by default. Thanks for the support! |
Thanks, for the reply. I am not saying it is a bug, I am just saying it would just be better to have default value for allowEmpty set to false, so it would not be breaking change. But I understand it is too late for that. |
Describe the bug
The default behavior of the SelectButton was broken when new feature (SelectButton: Add allowEmpty property #13853) was implemented.
Also, the SelectButton PrimeNG demo is now broke.
The first video is showing the PrimeNG v15.4.9-lts PrimeNG SelectButton demo working properly
v15SelectButtonDemoWorkingProperly.mov
The second video is showing the current PrimeNG SelectButton demo broken.
v16SelectButtonDemoBroken.mov
Workaround: For all legacy code (including the PrimeNG SelectButton demo) set allowEmpty property to false
Environment
mac os and windows
Reproducer
https://primeng.org/selectbutton
Angular version
16.x
PrimeNG version
16.5.0
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
18.18.1
Browser(s)
safari, chrome, firefox
Steps to reproduce the behavior
Expected behavior
After step 4, the "Off" button should have remained blue (and in a "selected" state)
The text was updated successfully, but these errors were encountered: