diff --git a/framework/core/js/src/forum/components/PostStream.js b/framework/core/js/src/forum/components/PostStream.js index dee970fd9..eef7d6b9c 100644 --- a/framework/core/js/src/forum/components/PostStream.js +++ b/framework/core/js/src/forum/components/PostStream.js @@ -353,6 +353,8 @@ export default class PostStream extends Component { return Promise.all([$container.promise(), this.stream.loadPromise]).then(() => { this.updateScrubber(); + this.stream.forceUpdateScrubber = true; + const index = $item.data('index'); m.redraw.sync(); diff --git a/framework/core/js/src/forum/components/PostStreamScrubber.js b/framework/core/js/src/forum/components/PostStreamScrubber.js index 93abaaecd..ef145809b 100644 --- a/framework/core/js/src/forum/components/PostStreamScrubber.js +++ b/framework/core/js/src/forum/components/PostStreamScrubber.js @@ -90,7 +90,10 @@ export default class PostStreamScrubber extends Component { } onupdate() { - this.stream.loadPromise.then(() => this.updateScrubberValues({ animate: true, forceHeightChange: true })); + if (this.stream.forceUpdateScrubber) { + this.stream.forceUpdateScrubber = false; + this.stream.loadPromise.then(() => this.updateScrubberValues({ animate: true, forceHeightChange: true })); + } } oncreate(vnode) { diff --git a/framework/core/js/src/forum/states/PostStreamState.js b/framework/core/js/src/forum/states/PostStreamState.js index 356bfa18d..355db56be 100644 --- a/framework/core/js/src/forum/states/PostStreamState.js +++ b/framework/core/js/src/forum/states/PostStreamState.js @@ -37,6 +37,18 @@ class PostStreamState { */ this.description = ''; + /** + * When the page is scrolled, goToIndex is called, or the page is loaded, + * various listeners result in the scrubber being updated with a new + * position and values. However, if goToNumber is called, the scrubber + * will not be updated. Accordingly, we add logic to the scrubber's + * onupdate to update itself, but only when needed, as indicated by this + * property. + * + * @type {Boolean} + */ + this.forceUpdateScrubber = false; + this.show(includedPosts); }