Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
onChange not firing properly in React 15 + IE11 when clearing input with X button or rightclick -> Delete #6822
The onChange event for inputs does not seem to be working correctly in React 15 when using the clear (X) button provided by IE (I'm using IE11). Clicking the clear button does not fire an immediate onChange at the time of click; rather, it seems that it "queues" an onChange that fires the next time text is entered, effectively rapid-firing two onChanges in succession. This becomes a problem when using a component that maps its state to two (or more, probably) inputs' values.
In the React 15 fiddle, you can reproduce in IE11 by:
You should see that the right input box reverts to its value before you clicked X. You can also see this happening if, instead of clicking X to clear the right input, you highlight the input text, right click, and click 'Delete'. Both the X button and right-click -> delete cases work fine with React 0.14 (tested both fiddles with the exact same browser and code).
referenced this issue
May 25, 2016
same as the others I think, fires an onInput/onChange but not a propertychange event which is what the polyfill is looking for.
seems ie11 was serious about distancing itself from vendor features... can't believe I'm complaining about that :P should be fixed in master...still saying we could put that in 15 if we wanted...
To get around this issue for the time being I created a stateless component to use onInput instead of onChange for IE 11.