Chrome Version: 64.0.3282.190 (Official Build) (64-bit)
Platform: 10176.76.0 (Official Build) stable-channel panther
What steps will reproduce the problem?
(1) In an IME extension, register a listener that commits text before indicating that it has handled the keystroke:
chrome.input.ime.onKeyEvent.addListener((engineID, keyData) => {
chrome.input.ime.commitText({contentID: contentID, text: "-"});
return true;
});
(2) With the extension's input method enabled, press the Tab or Backspace key.
What is the expected result?
The text is committed, and the default action of the key is canceled.
What happens instead?
The default action of the key occurs, *then* the text is committed.
As a workaround, the key event seems to be canceled correctly if I add an explicit call to keyEventHandled before invoking commitText:
chrome.input.ime.onKeyEvent.addListener((engineID, keyData) => {
chrome.input.ime.keyEventHandled(keyData.requestId, true);
chrome.input.ime.commitText({contentID: contentID, text: "-"});
return true;
});
Comment 1 by bcmi...@google.com
, Mar 28 2018