summaryrefslogtreecommitdiffstats
path: root/chromium/chrome/browser/resources/settings/settings_ui/settings_ui.js
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/chrome/browser/resources/settings/settings_ui/settings_ui.js')
-rw-r--r--chromium/chrome/browser/resources/settings/settings_ui/settings_ui.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/chromium/chrome/browser/resources/settings/settings_ui/settings_ui.js b/chromium/chrome/browser/resources/settings/settings_ui/settings_ui.js
index 12801134687..7913ebb4a9d 100644
--- a/chromium/chrome/browser/resources/settings/settings_ui/settings_ui.js
+++ b/chromium/chrome/browser/resources/settings/settings_ui/settings_ui.js
@@ -165,7 +165,12 @@ Polymer({
settings.setGlobalScrollTarget(this.$.container);
const scrollToTop = top => new Promise(resolve => {
- this.$.container.scrollTo({top, behavior: 'smooth'});
+ // When transitioning back to main page from a subpage on ChromeOS, using
+ // 'smooth' scroll here results in the scroll changing to whatever is last
+ // value of |top|. This happens even after setting the scroll position the
+ // UI or programmatically.
+ const behavior = cr.isChromeOS ? 'auto' : 'smooth';
+ this.$.container.scrollTo({top: top, behavior: behavior});
const onScroll = () => {
this.debounce('scrollEnd', () => {
this.$.container.removeEventListener('scroll', onScroll);