diff --git a/package.json b/package.json index 0350df4..01749f9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vaul", - "version": "0.9.7", + "version": "0.9.8", "description": "Drawer component for React.", "main": "./dist/index.js", "module": "./dist/index.mjs", diff --git a/src/index.tsx b/src/index.tsx index 3bac0fa..f70ea42 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -707,9 +707,12 @@ export const Overlay = React.forwardRef { - document.body.style.pointerEvents = 'auto'; - }); + if (typeof window !== 'undefined') { + window.requestAnimationFrame(() => { + document.body.style.pointerEvents = 'auto'; + }); + } + return null; }