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

onChange behaviour on radio buttons in 15.6.2 #12172

Closed
saenglert opened this issue Feb 7, 2018 · 3 comments
Closed

onChange behaviour on radio buttons in 15.6.2 #12172

saenglert opened this issue Feb 7, 2018 · 3 comments

Comments

@saenglert
Copy link

Do you want to request a feature or report a bug?
A bug

What is the current behavior?
When assigning the onChange listener on a radio button group (or its form) the event only fires once per radio button

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:
I created a basic example of the problem (which is working in jsfiddle since I guess its using the most up to date version of react)
https://jsfiddle.net/6vco4t1h/1/
I also found a workaround for the problem by using a components internal state detailed here:
https://jsfiddle.net/6vco4t1h/

What is the expected behavior?
The onChange event should fire every time the selected radio button changes

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
Affected version is 15.6.2 and as far as I can tell it happens across all browsers. I did not check previous but future versions and in 16.x this problem appears to be fixed (sadly we are still in in the process of preparing for the update to 16.x).

@sangle7
Copy link

sangle7 commented Feb 8, 2018

same, finding this bug is related to react-dom.

@aweary
Copy link
Contributor

aweary commented Feb 8, 2018

Hey @saenglert, this was a known issue with 15.6.2. This was tracked in #10739 and resolved by #11028, but there hasn't been any patch releases for 15 since. We may release 15.6.3 (#11573), but it's uncertain at the moment.

We definitely recommend upgrading to 16 if you can, there's lots of great stuff to make it worth your while 🙂

@riteshnus
Copy link

Still issue persist in 16.2.0, i am launching the event onChnage, but not getting the event name or value from the passed event parameter.

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

No branches or pull requests

4 participants