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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/FilterBar.js

Issue 2574823002: DevTools: do not make main panel unconditionally focused by default. (Closed)
Patch Set: fixed the test Created 4 years 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/FilterBar.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/FilterBar.js b/third_party/WebKit/Source/devtools/front_end/ui/FilterBar.js
index 34afd71e2d4b703e25d04a2845b15d9bad147a0a..1bdfe003dd463ade82fd8f5562b04c6f7b4978c1 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/FilterBar.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/FilterBar.js
@@ -97,15 +97,17 @@ UI.FilterBar = class extends UI.HBox {
_updateFilterBar() {
var visible = this._alwaysShowFilters || (this._filtersShown && this._enabled);
this.element.classList.toggle('hidden', !visible);
- if (visible) {
- for (var i = 0; i < this._filters.length; ++i) {
- if (this._filters[i] instanceof UI.TextFilterUI) {
- var textFilterUI = /** @type {!UI.TextFilterUI} */ (this._filters[i]);
- textFilterUI.focus();
- }
+ this.invalidateSize();
+ }
+
+ _focusTextField() {
+ for (var i = 0; i < this._filters.length; ++i) {
+ if (this._filters[i] instanceof UI.TextFilterUI) {
+ var textFilterUI = /** @type {!UI.TextFilterUI} */ (this._filters[i]);
+ textFilterUI.focus();
+ break;
}
}
- this.invalidateSize();
}
_updateFilterButton() {
@@ -141,6 +143,8 @@ UI.FilterBar = class extends UI.HBox {
this._updateFilterButton();
this._updateFilterBar();
+ if (this._filtersShown)
+ this._focusTextField();
this.dispatchEventToListeners(UI.FilterBar.Events.Toggled);
}

Powered by Google App Engine
This is Rietveld 408576698