Input elements become unusable when new input elements are added with JavaScript after parent element is cleared using innerHTML

Fixed Issue #106319

Details

Created
Apr 27, 2014
Privacy
This issue is public.
Found in build #
0.0011
Reports
Reported by 0 people

Sign in to watch or report this issue.

Steps to reproduce

URhttp://jsfiddle.net/QXKK3/](http://jsfiddle.[http://jsfiddle.net/QXKK3/](http://jsfiddle.net/QXKK3/)

URL:

Repro Steps:

Open the page with the attached code in IE 11 (also below).
Click the existing input element.
Press the tab key.
Enter one or more characters in the new input element (which will now have focus). (if no characters are entered, the bug will not occur)
Press the tab key.
All input elements on the page can no longer accept input.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml” xml:lang="en" lang="en">
<head>
<title>IE11 Test</title>
</head>
<body>
<input id="input1" type="text" value=""/>
<div id="test">
</div>

<script type="text/javascript">
function inputKeyPressed(evt)
{
if(evt.which == 9)
{

var div = document.getElementById(“test”);
var input = document.createElement(“input”);
input.type = "text";
input.onkeydown = inputKeyPressed;
div.innerHTML = "";
div.appendChild(input);
input.focus();

evt.preventDefault();
return false;
}
}
document.getElementById(“input1”).onkeydown = inputKeyPressed;
</script>

</body>
</html>

Expected Results:

The input element should be editable. Oddly, its keyup / keypress events are fired, but its value is not changed.

Actual Results:

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “IPBS P.”

      Changed Assigned To from “IPBS P.” to “Bruce M.”

      Changed Assigned To to “Amit J.”

      Changed Assigned To from “Amit J.” to “Ben P.”

      Changed Steps to Reproduce

      Changed Status to “Confirmed”

      Changed Assigned To from “Ben P.” to “IPBS P.”

      Changed Status from “Confirmed” to “Fixed”

      Changed Assigned To from “IPBS P.” to “Ethan C.”

      Changed Assigned To from “Ethan C.” to “John J.”

    You need to sign in to your Microsoft account to add a comment.

    Sign in