From 84f7d29d8cd986ebd769ceed6c71172593b3fad9 Mon Sep 17 00:00:00 2001 From: Alexander Skvortsov Date: Wed, 7 Oct 2020 14:09:53 -0400 Subject: [PATCH] Slight PostStream scrubber improvement After we scroll to a post, we redraw to render post content. We then update the scrubber again so its height is accurate. This commit moves that update to AFTER our adjustment of scroll position, so that scrubber height is based on actual post heights. This fixes some subtle scrubber glitches. --- js/src/forum/components/PostStream.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/src/forum/components/PostStream.js b/js/src/forum/components/PostStream.js index 21d6ee240..667d27694 100644 --- a/js/src/forum/components/PostStream.js +++ b/js/src/forum/components/PostStream.js @@ -359,9 +359,6 @@ export default class PostStream extends Component { return Promise.all([$container.promise(), this.stream.loadPromise]).then(() => { m.redraw.sync(); - // We want to adjust this again after posts have been loaded in so that - // the height of the scrubber is accurate. - updateScrubberHeight(); // After post data has been loaded in, we will attempt to scroll back // to the top of the requested post (or to the top of the page if the @@ -377,6 +374,10 @@ export default class PostStream extends Component { $(window).scrollTop($(`.PostStream-item[data-index=${index}]`).offset().top - this.getMarginTop()); } + // We want to adjust this again after posts have been loaded in + // and position adjusted so that the scrubber's height is accurate. + updateScrubberHeight(); + this.calculatePosition(); this.stream.paused = false; });