Possible incorrect event.target on number inputs in IE9?
See original GitHub issueSince 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
- Open this build of the fixtures: http://react-ie-9-target-issues.surge.sh in IE9
- Enter text into an input
- Observe that the
event.target.value
is the window, as recorded by the fixture
I 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: https://github.com/facebook/react/compare/master...nhunzaker:ie9-target-issue
Any idea what’s going on? Here’s what I think I need to check next:
- Differences in rAF polyfill
- Differences in map/set polyfill
This list will probably grow
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:8 (2 by maintainers)
Top Results From Across the Web
How to access Event.target in IE9? - Stack Overflow
In IE9 mode (IE11) event.target was available as a local variable to the function, don't know if it differs from the real IE9....
Read more >HTMLElement: input event - Web APIs | MDN
The input event fires when the value of an <input> , <select> , or <textarea> element has been changed. The event also applies...
Read more >A near-perfect oninput shim for IE 8 and 9 - Sophie Alpert
The input event was created to solve all of these problems. It fires immediately whenever the value of a text box changes, whether...
Read more >UI Events - W3C
Event objects are dispatched to an event target. ... Numbers greater than 2 are also possible, but are not specified in this document....
Read more >DOMFocusIn event JavaScript - Dottoro Web Reference
In HTML: This event cannot be registered in HTML. In JavaScript: object.addEventListener ("DOMFocusIn", handler, useCapture);. The event object is accessible to ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Fixed in React 16.4.1.
Just an additional observation if it might help,
event.target
for onChange returns [Window] for any character typed in an input field whereas deleting the character (backspace or delete) returns [HTMLInputElement].event.target
for onKeyUp returns [HTMLInputElement].