Why does IE11 duplicate content when pressing Ctrl + Z when setting the value of a text field to onkeyup?

In IE11 on Windows 7/8 / 8.1, if the onkeyup event in the maniuplates text box is a property value, the copy is duplicated.

Example:

<input value="abc" onkeyup="this.value = this.value;" />
Run codeHide result

In IE11, click in the text box and type a character (or delete it). Then click Ctrl+Zto cancel it. Regardless of the content left in the field, the cancel operation will be duplicated.

Edit: Sent to Internet Explorer Reviews on MS Connect

+4
source share
1 answer

while IE11 fixes this error, you can solve this problem as follows:

<input onkeyup="var evtobj = window.event? event : e;if (evtobj.keyCode !== 90 && evtobj.ctrlKey) this.value =this.value;">
Run codeHide result

+1

All Articles