Commit b28fb0f5 authored by Jacob Dufault's avatar Jacob Dufault Committed by Commit Bot

cros: Fix incorrect password dialog being immediately dismissed in tablet mode.

This repros by

  - Open login or lock screen, enter tablet mode
  - Type password using VK
  - Dismiss VK
  - Hit the submit button on the password field

You can also submit by hitting 'enter' on the VK

Bug: 892270
Change-Id: I39b40c6710a3ddca22cd110255f05014a9134798
Reviewed-on: https://chromium-review.googlesource.com/c/1287177Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Jacob Dufault <jdufault@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601306}
parent 7be964fa
......@@ -545,8 +545,15 @@ void LoginBubble::OnGestureEvent(ui::GestureEvent* event) {
}
void LoginBubble::OnKeyEvent(ui::KeyEvent* event) {
if (!bubble_view_ || event->type() != ui::ET_KEY_PRESSED)
// Ignore VKEY_PROCESSKEY; it is an IME event saying that the key has been
// processed. This event is also generated in tablet mode, ie, after
// submitting a password a VKEY_PROCESSKEY event is generated. If we treat
// that as a normal key event the password bubble will be dismissed
// immediately after submitting.
if (!bubble_view_ || event->type() != ui::ET_KEY_PRESSED ||
event->key_code() == ui::VKEY_PROCESSKEY) {
return;
}
// If current focus view is the button view, don't process the event here,
// let the button logic handle the event and determine show/hide behavior.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment