A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/facebook/react/issues/6822 below:

onChange not firing properly in React 15 + IE11 when clearing input with X button or rightclick -> Delete · Issue #6822 · facebook/react · GitHub

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.

I made two fiddles with different versions of React and ReactDOM.
React 15 fiddle (buggy): https://jsfiddle.net/yde4wgaa/3/
React 0.14 fiddle (working): https://jsfiddle.net/f0tv528v/1/

In the React 15 fiddle, you can reproduce in IE11 by:

  1. typing a value into the left input box
  2. typing another value into the right input box
  3. clicking the X button to clear the right input box
  4. typing whatever in the left input box

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

richardjli, jwbay, jonathanq, shaned24, petermikitsh and 9 morerichardjlirichardjliczbComeOnrichardjli


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4