-
Notifications
You must be signed in to change notification settings - Fork 47.4k
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
Possible incorrect event.target on number inputs in IE9? #12506
Comments
Hello! Have the same issue in React 16.3.0 on IE9 (16.2.0 work correctly). Several libraries (react-autosuggest and react-input-mask) try to use event.target.value inside onChange handler, and get undefined (and don't check the value type). And all string methods break down. event.target is Window. |
Reproduce in jsbin (opens in ie9) http://jsbin.com/loqeqatuti/1/edit |
@SuperOleg39 Thanks! It's very helpful to have a secondary confirmation. Now what to do... I'll take some time to dig into what might be happening in the event system, however I probably won't be able to get to this until later this week if anyone wants to do some research as well! |
Stripe is also seeing this bug when upgrading our Elements codebase to react 16.3.2. Two small notes that I learned when debugging the jsbin above to check that it matched our problem:
When debugging a bit further, I found that when the event handler is called in IE9:
Adding an event handler to the same node through the raw DOM API, the browser-native event has the expected value on |
It is this commit that causes the issue. Just changing this line in the source makes it work again. let target = nativeEvent.target || nativeEvent.srcElement || window; Trying to find ways around it... |
the same issue, thanks to @SuperOleg39 and @LeadingLight , downgrade to react@16.2.0 is ok. |
Just an additional observation if it might help,
|
It looks like we accidentally removed a fallback condition for the event target in IE9 when we dropped some support for IE8. This commit adds the event target specific support code back to getEventTarget.js Fixes facebook#12506
It looks like we accidentally removed a fallback condition for the event target in IE9 when we dropped some support for IE8. This commit adds the event target specific support code back to getEventTarget.js Fixes facebook#12506
It looks like we accidentally removed a fallback condition for the event target in IE9 when we dropped some support for IE8. This commit adds the event target specific support code back to getEventTarget.js Fixes #12506
Fixed in React 16.4.1. |
Since React 16.0.0, it looks like there might be a case where
event.target
on a change event in IE9 reports as the window, but I can't reproduce it outside of the DOM test fixtures.Steps to reproduce
event.target.value
is the window, as recorded by the fixtureI can not reproduce this using the following CodePen:
https://codepen.io/nhunzaker/pen/dmeoxJ?editors=1010
Viewable in IE9 here: https://s.codepen.io/nhunzaker/debug/dmeoxJ/PNrvYLevqQbM
Here's a diff of my changes with master:
master...nhunzaker:ie9-target-issue
Any idea what's going on? Here's what I think I need to check next:
This list will probably grow
The text was updated successfully, but these errors were encountered: