Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(534)

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui_lazy/FilteredListWidget.js

Issue 2016963002: DevTools: rework focus logic (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove stray newline Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/ui_lazy/FilteredListWidget.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui_lazy/FilteredListWidget.js b/third_party/WebKit/Source/devtools/front_end/ui_lazy/FilteredListWidget.js
index e3f4bf7407d8960f5041779501623e64bd099891..e784a3e3e93c90f81bea074f1fba4dd607efa367 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui_lazy/FilteredListWidget.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui_lazy/FilteredListWidget.js
@@ -102,9 +102,11 @@ WebInspector.FilteredListWidget.prototype = {
if (!this._delegate.itemCount())
return;
var selectedIndex = this._shouldShowMatchingItems() && this._selectedIndexInFiltered < this._filteredItems.length ? this._filteredItems[this._selectedIndexInFiltered] : null;
- this._delegate.selectItemWithQuery(selectedIndex, this._value());
+
+ // Detach dialog before allowing delegate to override focus.
if (this._dialog)
this._dialog.detach();
+ this._delegate.selectItemWithQuery(selectedIndex, this._value());
},
_itemsLoaded: function()
@@ -353,9 +355,11 @@ WebInspector.FilteredListWidget.prototype = {
var itemElement = event.target.enclosingNodeOrSelfWithClass("filtered-list-widget-item");
if (!itemElement)
return;
- this._delegate.selectItemWithQuery(itemElement._index, this._value());
+
+ // Detach dialog before allowing delegate to override focus.
if (this._dialog)
this._dialog.detach();
+ this._delegate.selectItemWithQuery(itemElement._index, this._value());
},
/**

Powered by Google App Engine
This is Rietveld 408576698