question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Possible incorrect event.target on number inputs in IE9?

See original GitHub issue

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

  1. Open this build of the fixtures: http://react-ie-9-target-issues.surge.sh in IE9
  2. Enter text into an input
  3. 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:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
gaearoncommented, Jun 13, 2018

Fixed in React 16.4.1.

0reactions
kiran-r28commented, May 22, 2018

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].

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found