1
0
mirror of https://github.com/flarum/core.git synced 2025-08-08 01:16:52 +02:00

Add anchorScroll with redraw after loadPromise loads in scrollToItem

This commit is contained in:
Alexander Skvortsov
2020-07-06 22:04:37 -04:00
committed by Franz Liedke
parent ac1eef7578
commit 9572863648

View File

@@ -3,6 +3,7 @@ import ScrollListener from '../../common/utils/ScrollListener';
import PostLoading from './LoadingPost';
import ReplyPlaceholder from './ReplyPlaceholder';
import Button from '../../common/components/Button';
import anchorScroll from '../../common/utils/anchorScroll';
/**
* The `PostStream` component displays an infinitely-scrollable wall of posts in
@@ -339,6 +340,9 @@ export default class PostStream extends Component {
}
return $container.promise().then(() => {
this.state.loadPromise.then(() => {
anchorScroll($item[0], () => m.redraw(true));
});
this.state.unpause();
this.calculatePosition();
this.updateScrubber();