Fixes columns scrolling to top when opening media modal

Fixes #700
This commit is contained in:
Thibaut Girka authored and ThibG committed 2018-09-03 14:24:10 +02:00
1 parent 2b82829a53
commit e915bc3e9e
17 files changed
+31 -61

No files matched your search

@@ -149,6 +149,10 @@ export default class ScrollableList extends PureComponent {
this.props.onLoadMore();
}
defaultShouldUpdateScroll = (prevRouterProps, { location }) => {
return !(location.state && location.state.mastodonModalOpen);
}
render () {
const { children, scrollKey, trackScroll, shouldUpdateScroll, isLoading, hasMore, prepend, emptyMessage, onLoadMore } = this.props;
const { fullscreen } = this.state;
@@ -190,7 +194,7 @@ export default class ScrollableList extends PureComponent {
if (trackScroll) {
return (
<ScrollContainer scrollKey={scrollKey} shouldUpdateScroll={shouldUpdateScroll}>
<ScrollContainer scrollKey={scrollKey} shouldUpdateScroll={shouldUpdateScroll || this.defaultShouldUpdateScroll}>
{scrollableArea}
</ScrollContainer>
);