Index: chrome/browser/resources/settings/settings_page/main_page_behavior.js |
diff --git a/chrome/browser/resources/settings/settings_page/main_page_behavior.js b/chrome/browser/resources/settings/settings_page/main_page_behavior.js |
index 904b12fa399d2a7536443a3ef7cdaacdff336c91..ce1581225272332145660dd1e31012a22fad65e4 100644 |
--- a/chrome/browser/resources/settings/settings_page/main_page_behavior.js |
+++ b/chrome/browser/resources/settings/settings_page/main_page_behavior.js |
@@ -9,6 +9,19 @@ |
* @polymerBehavior MainPageBehavior |
*/ |
var MainPageBehaviorImpl = { |
+ properties: { |
+ /** |
+ * Whether a search operation is in progress or previous search results are |
+ * being displayed. |
+ * @private {boolean} |
+ */ |
+ inSearchMode: { |
+ type: Boolean, |
+ value: false, |
+ observer: 'inSearchModeChanged_', |
+ }, |
+ }, |
+ |
/** @type {?HTMLElement} The scrolling container. */ |
scroller: null, |
@@ -48,6 +61,16 @@ var MainPageBehaviorImpl = { |
}, |
/** |
+ * When exiting search mode, we need to make another attempt to scroll to |
+ * the correct section, since it has just been re-rendered. |
+ * @private |
+ */ |
+ inSearchModeChanged_: function(inSearchMode) { |
+ if (!inSearchMode) |
+ this.tryTransitionToSection_(!settings.lastRouteChangeWasPopstate()); |
+ }, |
+ |
+ /** |
* If possible, transitions to the current route's section (by expanding or |
* scrolling to it). If another transition is running, finishes or cancels |
* that one, then schedules this function again. This ensures the current |