From 573fdbc981a54402f5b46cc5bb3845bd43d6625e Mon Sep 17 00:00:00 2001 From: Developer <> Date: Thu, 25 Feb 2021 11:02:45 -0500 Subject: [PATCH] Fixed issue with MediaModal causing page to scroll to top on open MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Fixed: - issue with MediaModal causing page to scroll to top on open The code in this removal was used to enable a back-btn to close the media modal. But unintended scrolling is more important than a third option to close a dialog. (Click X, press escape) --- .../gabsocial/components/modal/media_modal.js | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/app/javascript/gabsocial/components/modal/media_modal.js b/app/javascript/gabsocial/components/modal/media_modal.js index 791e0983..5128d7fb 100644 --- a/app/javascript/gabsocial/components/modal/media_modal.js +++ b/app/javascript/gabsocial/components/modal/media_modal.js @@ -67,28 +67,10 @@ class MediaModal extends ImmutablePureComponent { componentDidMount() { window.addEventListener('keydown', this.handleKeyDown, false) - - if (this.context.router) { - const history = this.context.router.history - - history.push(history.location.pathname, previewState) - - this.unlistenHistory = history.listen(() => { - this.props.onClose() - }) - } } componentWillUnmount() { window.removeEventListener('keydown', this.handleKeyDown) - - if (this.context.router) { - this.unlistenHistory() - - if (this.context.router.history.location.state === previewState) { - this.context.router.history.goBack() - } - } } getIndex() {