Skip to content

Commit

Permalink
Ensure change count only decreases when events fire (#819)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenna Smith authored Aug 11, 2021
1 parent f5e3289 commit b824891
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .yarn/versions/658485e8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
releases:
"@radix-ui/react-alert-dialog": patch
"@radix-ui/react-context-menu": patch
"@radix-ui/react-dialog": patch
"@radix-ui/react-dismissable-layer": patch
"@radix-ui/react-dropdown-menu": patch
"@radix-ui/react-menu": patch
"@radix-ui/react-popover": patch
"@radix-ui/react-use-body-pointer-events": patch

declined:
- primitives
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function useBodyPointerEvents({ disabled }: { disabled: boolean }) {
}

function resetPointerEvents() {
changeCount--;
if (changeCount === 0) {
document.body.style.pointerEvents = originalBodyPointerEvents;
}
Expand All @@ -42,7 +43,6 @@ function useBodyPointerEvents({ disabled }: { disabled: boolean }) {
changeCount++;

return () => {
changeCount--;
if (isTouchOrPenPressedRef.current) {
/**
* We force pointer-events to remain disabled until `click` fires on touch devices
Expand Down

0 comments on commit b824891

Please sign in to comment.