Skip to content

Commit

Permalink
Fix pointer events none
Browse files Browse the repository at this point in the history
  • Loading branch information
emilkowalski committed Sep 25, 2024
1 parent 32024ab commit a3841c6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,12 @@ 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) {
window.requestAnimationFrame(() => {
document.body.style.pointerEvents = 'auto';
});
return null;
}

return (
<DialogPrimitive.Overlay
Expand Down

0 comments on commit a3841c6

Please sign in to comment.