1
0
mirror of https://github.com/flarum/core.git synced 2025-08-08 09:26:34 +02:00

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.

This commit is contained in:
Alexander Skvortsov
2020-07-06 22:20:04 -04:00
committed by Franz Liedke
parent 9db2f78939
commit 0c63be527b

View File

@@ -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();