Commit 65827fc5 authored by Weidong Guo's avatar Weidong Guo Committed by Commit Bot

Fix on-screen keyboard issue when search box is focused

Background:
In some devices like nocturne, on-screen keyboard pops up when launcher
is focused. When launcher is focused, search box textfield will be the
initial focused view. SearchBoxViewBase::ContentsChanged() gets called
to activate the search box, which triggers the on-screen keyboard.

Change:
Avoid activate the search box when new contents are empty string.

Bug: 895249
Change-Id: I32b0f5a76037b5287d1b179fa20140101ce4f853
Reviewed-on: https://chromium-review.googlesource.com/c/1284754Reviewed-by: default avatarAlex Newcomer <newcomer@chromium.org>
Commit-Queue: Weidong Guo <weidongg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600577}
parent 1d6dbc64
......@@ -490,8 +490,8 @@ void SearchBoxViewBase::UpdateButtonsVisisbility() {
if (close_button_->visible() == should_show_close_button &&
assistant_button_->visible() == should_show_assistant_button &&
search_box_right_space_->visible() ==
should_show_search_box_right_space) {
return;
should_show_search_box_right_space) {
return;
}
close_button_->SetVisible(should_show_close_button);
......@@ -507,7 +507,8 @@ void SearchBoxViewBase::ContentsChanged(views::Textfield* sender,
search_box_->RequestFocus();
UpdateModel(true);
NotifyQueryChanged();
SetSearchBoxActive(true, ui::ET_KEY_PRESSED);
if (!new_contents.empty())
SetSearchBoxActive(true, ui::ET_KEY_PRESSED);
UpdateButtonsVisisbility();
}
......
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