New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Dialog][AlertDialog][Popover][DropdownMenu] Prevent pointer-events reenabling prematurely (mobile) #767
Conversation
23978da
to
93babbd
Compare
93babbd
to
876939e
Compare
Alternatively, we can change |
c2484eb
to
83fff03
Compare
bf88e97
to
f302975
Compare
f302975
to
c22c2c9
Compare
packages/react/use-body-pointer-events/src/useBodyPointerEvents.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the direction of this new solution!
One thing I've been wondering: does this also negate the need for the change I have made in DismissableLayer
's usePointerDownOutside
?
packages/react/use-body-pointer-events/src/useBodyPointerEvents.tsx
Outdated
Show resolved
Hide resolved
Love this! |
@benoitgrelard Potentially, I'll try replicate the issue you were experiencing and confirm. |
Spoke to Benoit about his issue and we think the fix there is still required since the fix in this PR will only apply to modal things. |
Fixes #631
Fixes #761
Fixes #762
Fixes #763
I managed to fix these all in one go eventually.
@benoitgrelard I believe I've also managed to provide a solution that merges both of our suggestions. My main concern was to keep the fix within
useBodyPointerEvents
since the issue is a side-effect of pointer-events enabling too soon, but I've only enabled the delay onpointerdown
(because like you say, that's when it's an issue) and it's a touch or pen pointer.Happy to continue to discuss alternate solutions as well if we have any because obviously,
setTimeout
s are never ideal.UPDATE: Delay has been removed in favour of waiting for
click
event. I gave myself the idea here #767 (comment) 馃槄