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 --- app/javascript/flavours/glitch/features/blocks/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/javascript/flavours/glitch/features/blocks') diff --git a/app/javascript/flavours/glitch/features/blocks/index.js b/app/javascript/flavours/glitch/features/blocks/index.js index edd448921..4c8b16504 100644 --- a/app/javascript/flavours/glitch/features/blocks/index.js +++ b/app/javascript/flavours/glitch/features/blocks/index.js @@ -42,6 +42,10 @@ export default class Blocks extends ImmutablePureComponent { } } + shouldUpdateScroll = (prevRouterProps, { location }) => { + return !(location.state && location.state.mastodonModalOpen) + } + render () { const { intl, accountIds } = this.props; @@ -56,7 +60,7 @@ export default class Blocks extends ImmutablePureComponent { return ( - +
{accountIds.map(id => -- cgit