Skip to content

Commit

Permalink
fix: pointer events none (#449)
Browse files Browse the repository at this point in the history
* Fix pointer events none

* Add comment
  • Loading branch information
emilkowalski authored Sep 25, 2024
1 parent 32024ab commit 717a78d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,13 @@ export const Overlay = React.forwardRef<HTMLDivElement, React.ComponentPropsWith
const hasSnapPoints = snapPoints && snapPoints.length > 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 (
<DialogPrimitive.Overlay
Expand Down

0 comments on commit 717a78d

Please sign in to comment.