Lambert Lambert - 3 months ago 89
React JSX Question

OnChange event not firing on IE 11 for ReactJS component

In the React.js documentation, it says to use the onChange event for text areas. However, when I paste some text into an empty IE 11 text area, the onChange event does not fire. Funny, that it fires in the new Microsoft Edge browser, and all other browsers. Is there a recommended workaround for this for ReactJS?

From the ReactJS documentation:

Note:
For input and textarea, onChange supersedes — and should generally be used instead of — the DOM's built-in onInput event handler.

Answer

Have you tried adding an "onpaste" event as well. IE 11 does not treat all attribute set events like other browsers.

<input type="text" onpaste="myFunction()" value="Paste something in here"> 

Further info on this can be found on W3Schools site onpaste Event entry