From 717a78da10af18a9aa57e115642637b006c462a5 Mon Sep 17 00:00:00 2001 From: Emil Kowalski <36730035+emilkowalski@users.noreply.github.com> Date: Wed, 25 Sep 2024 18:47:10 +0200 Subject: [PATCH] fix: pointer events none (#449) * Fix pointer events none * Add comment --- src/index.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/index.tsx b/src/index.tsx index d63b99b..9535bda 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -703,7 +703,13 @@ export const Overlay = React.forwardRef 0; // Overlay is the component that is locking scroll, removing it will unlock the scroll without having to dig into Radix's Dialog library - if (!modal) return null; + if (!modal) { + // Need to do this manually unfortunately + window.requestAnimationFrame(() => { + document.body.style.pointerEvents = 'auto'; + }); + return null; + } return (