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

Disabled radio button (and checkbox) fires onChange event from double click in IE11 #8814

Closed
ocetnik opened this issue Jan 17, 2017 · 3 comments

Comments

@ocetnik
Copy link

ocetnik commented Jan 17, 2017

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

What is the current behavior?
Disabled radio button (and checkbox) fires onChange event from double click in IE11

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar.
http://jsfiddle.net/gttafz9t/2/

What is the expected behavior?
Disabled radio button (and checkbox) doesn't fire onChange event from double click in IE11

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
React 15.4.2, IE11 / Windows 8.1

Duplicate of:
#4457

@goztrk
Copy link

goztrk commented Jan 18, 2017

I think this is not a React bug rather browser difference problem. You can solve it easily with adding a if statement as event function's first line of code: if (e.target.disabled) { return null; }. with this it will not fire the event further. Check the sample code here: http://jsfiddle.net/gttafz9t/6/

@aweary
Copy link
Contributor

aweary commented Jan 18, 2017

Thanks for the report @ocetnik! This issue is present in the latest release (15.4.2) but is resolved in master. You can verify that with [this JSFiddle] which is using a recent build from master.

This was resolved by #5746 which, at the time, contained breaking changes so it was slated for the next major release. There is currently a PR open (#8575) that makes it non-breaking so we can backport it to 15.x and release it in a minor release.

I'm going to be reviewing #8575 soon and, should all go well, would expect it to land in the next minor release 🤞

@aweary aweary closed this as completed Jan 18, 2017
@aweary
Copy link
Contributor

aweary commented Jan 18, 2017

@Quanthir React does a number of normalizations for onChange events to make it easier to deal with. Part of that is addressing browser inconsistencies, so making this work in IE11 like it does elsewhere would be within the scope of what React provides as far as the event system goes.

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

3 participants