Browse Source

fix scroll position (#4821)

pull/4/head
Clworld 6 years ago
committed by Eugen Rochko
parent
commit
1646f622a5
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      app/javascript/mastodon/components/scrollable_list.js

+ 7
- 1
app/javascript/mastodon/components/scrollable_list.js View File

@ -5,6 +5,7 @@ import IntersectionObserverArticle from './intersection_observer_article';
import LoadMore from './load_more';
import IntersectionObserverWrapper from '../features/ui/util/intersection_observer_wrapper';
import { throttle } from 'lodash';
import { List as ImmutableList } from 'immutable';
export default class ScrollableList extends PureComponent {
@ -95,7 +96,12 @@ export default class ScrollableList extends PureComponent {
getFirstChildKey (props) {
const { children } = props;
const firstChild = Array.isArray(children) ? children[0] : children;
let firstChild = children;
if (children instanceof ImmutableList) {
firstChild = children.get(0);
} else if (Array.isArray(children)) {
firstChild = children[0];
}
return firstChild && firstChild.key;
}

Loading…
Cancel
Save