Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
danieltroger committed Aug 27, 2024
1 parent 660060a commit 4a379ef
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/react/dismissable-layer/src/DismissableLayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,11 @@ const DismissableLayer = React.forwardRef<DismissableLayerElement, DismissableLa
return () => {
if (!node) return;
context.layers.delete(node);
context.layersWithOutsidePointerEventsDisabled.delete(node);
const deletedAPointerEventsLayer = context.layersWithOutsidePointerEventsDisabled.delete(node);
if(!context.layersWithOutsidePointerEventsDisabled.size && deletedAPointerEventsLayer) {
// Work around https://github.com/radix-ui/primitives/issues/2597#issuecomment-2312839713
ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;
}
dispatchUpdate();
};
}, [node, context]);
Expand Down

0 comments on commit 4a379ef

Please sign in to comment.