diff --git a/src/index.tsx b/src/index.tsx index 3ed6755..a03637e 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -737,13 +737,13 @@ export function Root({ } React.useEffect(() => { - if (!modal) { + if (!modal && isOpen) { // Need to do this manually unfortunately window.requestAnimationFrame(() => { document.body.style.pointerEvents = 'auto'; }); } - }, [modal]); + }, [modal,isOpen]); return (