Fixed issue with MediaModal causing page to scroll to top on open

• 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)
This commit is contained in:
Developer 2021-02-25 11:02:45 -05:00
parent 444263a8b2
commit 573fdbc981

@ -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() {