Unable to simulate text input on Chrome dev browser |
|||
Issue descriptionChrome Version : Version 53.0.2785.8 dev (64-bit) Platform : Ubuntu 14.04 (64 bit) URLs (if applicable) : https://jsfiddle.net/bL8L4v3h/ Other browsers tested: Chrome Stable: Version 51.0.2704.106 (64-bit) - OK Chrome on MAC: Version 53 dev - OK Chrome on Win: Version 53 dev - Fail What steps will reproduce the problem? - Open the URL given above. Run the JSFiddle. - We are trying to simulate typing a character. For this, event 'TextEvent' is created and initialized with 'textInput' type. What is the expected result? Char 'X' is typed in the contentEditable div. What happens instead? Character is not entered. The div remains blank. We intend to simulate keyboard events in our unit test cases. We fire the events in order keydown, keypress, textinput and keyup for entering the text. With the current stable and beta version of Chrome, the text is typed on all, Win, MAC and Linux.
,
Jul 22 2016
This is intended behavior and doesn't work in other vendor browsers as well.
But you are fortunate:
document.execCommand("insertText", false, value);
will actually work correctly in all other vendors and chrome too.
See the modified fiddle: https://jsfiddle.net/j92tuh0q/
,
Sep 23 2016
Is there any way to trigger a trusted TextEvent from a chrome extension ?
,
Sep 23 2016
does execCommand not work for you? also check out these apis https://developer.chrome.com/extensions/input_ime https://developer.chrome.com/extensions/debugger
,
Sep 23 2016
execCommand surprisingly does work for me. Isn't it supposed to work only when the design mode is enabled, and never when this command is executed on inputs or textareas? About the APIs you gave a link for, input_ime only works on chrome OS, and the debugger API would probably work but it's a hell of a workaround, and is deactivated when the developer tools are toggled on.
,
Sep 27 2016
|
|||
►
Sign in to add a comment |
|||
Comment 1 by ajha@chromium.org
, Jul 22 2016Components: Blink>Input
Labels: -Pri-3 ReleaseBlock-Stable M-53 hasbisect OS-Mac Pri-1
Owner: dtapu...@chromium.org
Status: Assigned (was: Unconfirmed)