From 0c63be527b3d4552deaff4e9d748195364df9906 Mon Sep 17 00:00:00 2001 From: Alexander Skvortsov Date: Mon, 6 Jul 2020 22:20:04 -0400 Subject: [PATCH] Pass in a selector string to anchorScroll instead of a DOM element. Because the DOM element gets destroyed on redraw, it's offset height is interpreted as 0 which throws off our position in the stream. --- js/src/forum/components/PostStream.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/forum/components/PostStream.js b/js/src/forum/components/PostStream.js index fcf5ea228..c11759f0d 100644 --- a/js/src/forum/components/PostStream.js +++ b/js/src/forum/components/PostStream.js @@ -341,7 +341,7 @@ export default class PostStream extends Component { return $container.promise().then(() => { this.state.loadPromise.then(() => { - anchorScroll($item[0], () => m.redraw(true)); + anchorScroll(`.PostStream-item[data-index=${$item.data('index')}]`, () => m.redraw(true)); }); this.state.unpause(); this.calculatePosition();