]> cat aescling's git repositories - mastodon.git/commitdiff
Do not re-position scroll when loading more (inserting items from below) (#7344)
authorThibG <thib@sitedethib.com>
Thu, 3 May 2018 20:32:05 +0000 (22:32 +0200)
committerEugen Rochko <eugen@zeonfederated.com>
Thu, 3 May 2018 20:32:05 +0000 (22:32 +0200)
app/javascript/mastodon/components/scrollable_list.js

index f8a7f91d2e5319c477379e3ad1d2edbd36fd5f6b..7cdd63910e4f87d7b9d7ed53403fb7d6f9109556 100644 (file)
@@ -72,7 +72,7 @@ export default class ScrollableList extends PureComponent {
     const someItemInserted = React.Children.count(prevProps.children) > 0 &&
       React.Children.count(prevProps.children) < React.Children.count(this.props.children) &&
       this.getFirstChildKey(prevProps) !== this.getFirstChildKey(this.props);
-    if (someItemInserted && this.node.scrollTop > 0 || this.state.mouseOver) {
+    if (someItemInserted && this.node.scrollTop > 0 || (this.state.mouseOver && !prevProps.isLoading)) {
       return this.node.scrollHeight - this.node.scrollTop;
     } else {
       return null;