KeyboardEvent doesn't bring actual character input #15233
Labels
area-core-library
SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
closed-duplicate
Closed in favor of an existing report
library-html
This issue was originally filed by li....@intel.com
What steps will reproduce the problem?
1.
2.
3.
What is the expected output? What do you see instead?
Create a keyboard event, and dispatch it to specified DOM node, it works fine, the dom node can receive the keyboard event, but it doesn't bring actual char input, which is different from actual keyboard event.
What version of the product are you using? On what operating system?
I am using trunk building, chromium M33
Please provide any additional information below.
Sample Code:
<input type="text" id="name">
var name = document.getElementById("name");
name.onkeydown = function(event) {
var keyEvent = document.createEvent("KeyboardEvents");
keyEvent.initKeyboardEvent("keydown", event.bubbles, event.cancelable, event.view,
event.keyIdentifier, event.location, event.ctrlKey, event.altKey,
event.shiftKey, event.metaKey, event.altGraphKey);
name.dispatchEvent(keyEvent);
name.onkeydown = null;
}
If I input "a" char to the input node, I think "aa" should be displayed, since both real and virtual keyboard event are dispatched, but I just saw "a" in the input node.
The text was updated successfully, but these errors were encountered: