New issue
Advanced search Search tips

Issue 826884 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

chrome.input.ime fails to suppress Tab and Backspace keys if the handler calls commitText before returning

Project Member Reported by bcmi...@google.com, Mar 28 2018

Issue description

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

Summary: chrome.input.ime fails to suppress Tab and Backspace keys if the handler calls commitText before returning (was: chrome.input.ime fails to suppress Tab and Backspace keys after commitText is called)

Comment 2 by bcmi...@google.com, Mar 28 2018

Cc: azurewei@chromium.org
Components: UI>Input>Text>IME
Labels: OS-Chrome
Owner: shuchen@chromium.org
Status: Assigned (was: Untriaged)

Sign in to add a comment