Commit 01cb44b3 authored by Moe Ahmadi's avatar Moe Ahmadi Committed by Commit Bot

Fixes bug where Omnibox input wouldn't update on selecting the first ZPS

Currently Omnibox would clear the temporary text if the first results is
attempted to be selected using the arrow key. This prevents the first
zero-prefix result from being selected as there is no default matches in
that case. This CL fixes that by adding an extra condition to prevent
selection when there's no editing.

Bug: 996516
Change-Id: Idb3338fcc86233ce14f0de22dc4253691f5daf13
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1845913Reviewed-by: default avatarTommy Li <tommycli@chromium.org>
Commit-Queue: Moe Ahmadi <mahmadi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#703487}
parent 06f82ebb
...@@ -1179,7 +1179,7 @@ void OmniboxEditModel::OnUpOrDownKeyPressed(int count) { ...@@ -1179,7 +1179,7 @@ void OmniboxEditModel::OnUpOrDownKeyPressed(int count) {
// we should revert the temporary text same as what pressing escape would // we should revert the temporary text same as what pressing escape would
// have done. // have done.
const size_t line_no = GetNewSelectedLine(count); const size_t line_no = GetNewSelectedLine(count);
if (has_temporary_text_ && line_no == 0) { if (has_temporary_text_ && user_input_in_progress_ && line_no == 0) {
RevertTemporaryText(true); RevertTemporaryText(true);
} else { } else {
popup_model()->MoveTo(line_no); popup_model()->MoveTo(line_no);
......
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