Skip to content
Snippets Groups Projects
Unverified Commit 8576dce4 authored by Howon Lee's avatar Howon Lee Committed by GitHub
Browse files

Fullscreen scroll fix #15596 (#15621)

Scrolling gets disabled for the modal and then is supposed to be reenabled when modal is closed. However, SandboxedPortal eats the events that would tell the modal to go and do this. Do it on React lifecycle bits instead.
parent 612a0fc7
No related branches found
No related tags found
No related merge requests found
......@@ -137,23 +137,20 @@ export class FullPageModal extends Component {
}
componentDidUpdate() {
if (!this.state.isOpen) {
document.body.style.overflow = "";
}
this.setTopOfModalToBottomOfNav();
}
componentWillUnmount() {
this._modalElement.parentNode.removeChild(this._modalElement);
document.body.style.overflow = "";
}
handleDismissal = () => {
this.setState({ isOpen: false });
// restore scroll position and scrolling
document.body.style.overflow = "";
// On IE11 a timeout is required for the scroll to happen after the change of overflow setting
setTimeout(() => {
window.scrollTo(this._scrollX, this._scrollY);
}, 0);
// wait for animations to complete before unmounting
setTimeout(() => this.props.onClose && this.props.onClose(), 300);
};
......
......@@ -743,7 +743,7 @@ describe("scenarios > dashboard", () => {
});
});
it.skip("should be possible to scroll vertically after fullscreen layer is closed (metabase#15596)", () => {
it("should be possible to scroll vertically after fullscreen layer is closed (metabase#15596)", () => {
// Make this dashboard card extremely tall so that it spans outside of visible viewport
cy.request("PUT", "/api/dashboard/1/cards", {
cards: [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment