mirror of
https://github.com/prymitive/karma
synced 2026-05-09 03:36:44 +00:00
Merge pull request #135 from prymitive/modal-fix
fix(ui): don't try to enable scrolling on unmounted modal
This commit is contained in:
@@ -4,7 +4,7 @@ import PropTypes from "prop-types";
|
||||
|
||||
import { observer } from "mobx-react";
|
||||
|
||||
import { disableBodyScroll, enableBodyScroll } from "body-scroll-lock";
|
||||
import { disableBodyScroll, clearAllBodyScrollLocks } from "body-scroll-lock";
|
||||
|
||||
import {
|
||||
MountModal,
|
||||
@@ -23,7 +23,7 @@ const Modal = observer(
|
||||
if (isOpen) {
|
||||
disableBodyScroll(document.querySelector(".modal"));
|
||||
} else {
|
||||
enableBodyScroll(document.querySelector(".modal"));
|
||||
clearAllBodyScrollLocks();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user