From 786f6ff8b00529bc86ea56be396b321358837203 Mon Sep 17 00:00:00 2001 From: Robin Ward <robin.ward@gmail.com> Date: Thu, 11 Feb 2016 13:14:43 -0500 Subject: [PATCH] FIX: Use chrome's `scrollRestoration` to fix scrolling uses with history --- .../javascripts/discourse/lib/discourse-location.js.es6 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/lib/discourse-location.js.es6 b/app/assets/javascripts/discourse/lib/discourse-location.js.es6 index 48e7ef4aa..43b74ab1e 100644 --- a/app/assets/javascripts/discourse/lib/discourse-location.js.es6 +++ b/app/assets/javascripts/discourse/lib/discourse-location.js.es6 @@ -31,7 +31,12 @@ const DiscourseLocation = Ember.Object.extend({ @method initState */ initState() { - set(this, 'history', get(this, 'history') || window.history); + const history = get(this, 'history') || window.history; + if (history && history.scrollRestoration) { + history.scrollRestoration = "manual"; + } + + set(this, 'history', history); let url = this.formatURL(this.getURL()); const loc = get(this, 'location');