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: Default behavior is broken (and the PrimeNG SelectButton demo is also broke) #13907

Closed
rosenthalj opened this issue Oct 18, 2023 · 3 comments

Comments

@rosenthalj
Copy link
Contributor

rosenthalj commented Oct 18, 2023

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

  1. Go to the current PrimeNG SelectButton Demo: https://primeng.org/selectbutton
  2. Go to the "Basic" SelectButton Example
  3. The "Off" button will be blue, which indicates it is in a "selected" state
  4. Click the "Off" button
  5. The "Off" button will turn white and the "On" button will remain white. Note: both buttons will be be in an "unselected" state

Expected behavior

After step 4, the "Off" button should have remained blue (and in a "selected" state)

@rosenthalj rosenthalj added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Oct 18, 2023
@ghost
Copy link

ghost commented Oct 19, 2023

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 .

@cetincakiroglu
Copy link
Contributor

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!

@cetincakiroglu cetincakiroglu removed the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Oct 25, 2023
@ghost
Copy link

ghost commented Oct 25, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants