Fixes columns scrolling to top when opening media modal

Fixes #700
This commit is contained in:
Thibaut Girka
2018-09-03 13:32:35 +02:00
committed by ThibG
parent 2b82829a53
commit e915bc3e9e
17 changed files with 31 additions and 61 deletions

View File

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