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..264dcb893abe812c45f660000b9977eb79106640 100644 |
--- a/chrome/browser/resources/settings/settings_page/main_page_behavior.js |
+++ b/chrome/browser/resources/settings/settings_page/main_page_behavior.js |
@@ -75,9 +75,6 @@ var MainPageBehaviorImpl = { |
// If the section shouldn't be expanded, collapse it. |
if (!currentRoute.isSubpage() || expandedSection != currentSection) { |
promise = this.collapseSection_(expandedSection); |
- // Scroll to the collapsed section. |
- if (currentSection && scrollToSection) |
- currentSection.scrollIntoView(); |
} else { |
// Scroll to top while sliding to another subpage. |
this.scroller.scrollTop = 0; |
@@ -227,7 +224,11 @@ var MainPageBehaviorImpl = { |
var newSection = settings.getCurrentRoute().section && |
this.getSection(settings.getCurrentRoute().section); |
- this.scroller.scrollTop = this.origScrollTop_; |
+ // Scroll to the new section or the original position. |
+ if (newSection && !settings.lastRouteChangeWasPopstate()) |
+ newSection.scrollIntoView(); |
+ else |
+ this.scroller.scrollTop = this.origScrollTop_; |
this.currentAnimation_ = section.animateCollapse( |
/** @type {!HTMLElement} */(this.scroller)); |