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

Unified Diff: chrome/browser/resources/md_history/app.js

Issue 2369823002: MD History: Focus the search field on load without 'showing' it (Closed)
Patch Set: Closure Created 4 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/resources/md_history/app.crisper.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/md_history/app.js
diff --git a/chrome/browser/resources/md_history/app.js b/chrome/browser/resources/md_history/app.js
index 33e2c62d79a61eec7d0d97c1c32fad400fe67ff8..40b41e212c7d76e5d4366b2c01529d1df0f2a28f 100644
--- a/chrome/browser/resources/md_history/app.js
+++ b/chrome/browser/resources/md_history/app.js
@@ -114,8 +114,10 @@ Polymer({
// Focus the search field on load. Done here to ensure the history page
// is rendered before we try to take focus.
- if (!this.hasDrawer_) {
- this.focusToolbarSearchField();
+ var searchField =
+ /** @type {HistoryToolbarElement} */ (this.$.toolbar).searchField;
+ if (!searchField.narrow) {
+ searchField.getSearchInput().focus();
}
// Lazily load the remainder of the UI.
@@ -176,7 +178,7 @@ Polymer({
},
/**
- * Focuses the search bar in the toolbar.
+ * Shows and focuses the search bar in the toolbar.
*/
focusToolbarSearchField: function() { this.$.toolbar.showSearchField(); },
« no previous file with comments | « no previous file | chrome/browser/resources/md_history/app.crisper.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698