diff --git a/app/assets/javascripts/discourse/mixins/string-buffer.js.es6 b/app/assets/javascripts/discourse/mixins/string-buffer.js.es6 index ee40bf5ec06..943a972c6e4 100644 --- a/app/assets/javascripts/discourse/mixins/string-buffer.js.es6 +++ b/app/assets/javascripts/discourse/mixins/string-buffer.js.es6 @@ -25,7 +25,17 @@ export default Ember.Mixin.create({ const buffer = []; this.renderString(buffer); + // Chrome likes scrolling after HTML is set + // This happens if you navigate back and forth a few times + // Before removing this code confirm that this does not cause scrolling + // 1. Sort by views + // 2. Go to last post on one of the topics + // 3. Hit back + // 4. Go to last post on same topic + // 5. Expand likes + const scrollTop = $(window).scrollTop(); $sel.html(buffer.join('')); + $(window).scrollTop(scrollTop); }, rerenderString() {