Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js b/third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js |
| index 06d7a9c6ea20b68ef227a0a1d6812961d4031bb0..922a5aa96b3367f4f26cddd99b57283f08975c7e 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js |
| @@ -61,6 +61,8 @@ UI.SuggestBox = class { |
| this._rowHeight = 17; |
| this._userInteracted = false; |
| this._userEnteredText = ''; |
| + this._defaultSelectionIsDimmed = false; |
| + |
| /** @type {?string} */ |
| this._onlyCompletion = null; |
| @@ -81,6 +83,7 @@ UI.SuggestBox = class { |
| * @param {boolean} value |
| */ |
| setDefaultSelectionIsDimmed(value) { |
| + this._defaultSelectionIsDimmed = value; |
| this._element.classList.toggle('default-selection-is-dimmed', value); |
| } |
| @@ -259,8 +262,11 @@ UI.SuggestBox = class { |
| selectedItemChanged(from, to, fromElement, toElement) { |
| if (fromElement) |
| fromElement.classList.remove('selected', 'force-white-icons'); |
| - if (toElement) |
| - toElement.classList.add('selected', 'force-white-icons'); |
| + if (toElement) { |
| + toElement.classList.add('selected'); |
| + if (fromElement || this._userInteracted || !this._defaultSelectionIsDimmed) |
|
dgozman
2017/03/15 21:17:43
Why check for |fromElement|?
lushnikov
2017/03/16 08:25:46
In this case the _userInteracted is not yet update
|
| + toElement.classList.add('force-white-icons'); |
| + } |
| if (!to) |
| return; |
| this._applySuggestion(true); |