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

RadioButton: onChange event is called for each click #3636

Closed
mikejav opened this issue Nov 14, 2022 · 2 comments · Fixed by #3637
Closed

RadioButton: onChange event is called for each click #3636

mikejav opened this issue Nov 14, 2022 · 2 comments · Fixed by #3637
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@mikejav
Copy link

mikejav commented Nov 14, 2022

Describe the bug

The nature of the radio button's onChange event is that they should call the onChange event only when its state is actually changed.

Reproducer

https://codesandbox.io/s/radio-bux-7m27iq-7m27iq

PrimeReact version

8.7.2

React version

17.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

No response

Steps to reproduce the behavior

Click on the RadioButton circle element. The label works as expected.

radio-on-change

Expected behavior

When the RadioButton is clicked multiple times and if its state is "checked" - it should not call onChange.

@mikejav mikejav 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 14, 2022
@mikejav
Copy link
Author

mikejav commented Nov 14, 2022

Related issue: #3148

@melloware melloware self-assigned this Nov 14, 2022
@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Nov 14, 2022
@melloware melloware added this to the 8.7.3 milestone Nov 14, 2022
@melloware
Copy link
Member

melloware commented Nov 14, 2022

Regression caused by this fix: #3226 for issue #3220

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants