From b02bfe86ce26ef001420841673257c9c5326b45c Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Fri, 27 Jul 2018 17:59:52 +0200 Subject: Don't reset scroll position when opening a modal --- .../flavours/glitch/features/standalone/community_timeline/index.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/javascript/flavours/glitch/features/standalone/community_timeline') diff --git a/app/javascript/flavours/glitch/features/standalone/community_timeline/index.js b/app/javascript/flavours/glitch/features/standalone/community_timeline/index.js index c488f9541..08b9e9e57 100644 --- a/app/javascript/flavours/glitch/features/standalone/community_timeline/index.js +++ b/app/javascript/flavours/glitch/features/standalone/community_timeline/index.js @@ -47,6 +47,10 @@ export default class CommunityTimeline extends React.PureComponent { this.props.dispatch(expandCommunityTimeline({ maxId })); } + shouldUpdateScroll = (prevRouterProps, { location }) => { + return !(location.state && location.state.mastodonModalOpen) + } + render () { const { intl } = this.props; @@ -62,6 +66,7 @@ export default class CommunityTimeline extends React.PureComponent { timelineId='community' onLoadMore={this.handleLoadMore} scrollKey='standalone_public_timeline' + shouldUpdateScroll={this.shouldUpdateScroll} trackScroll={false} /> -- cgit