[Dialog] on touch devices blocks body input after closing #1236
Labels
Package: react/dialog
Priority: Urgent
Urgent priority issue
Resolution: Duplicate
This issue is a duplicate
Type: Bug
Confirmed bug
Milestone
Bug report
I've noticed that when I use a Dialog and I close it with a close button, it will block all pointer events on mobile devices until after I've clicked somewhere in the body. I originally thought it was because I was missing a Trigger component.
In my project, I'm opening the toolkit item based on URL state through interaction in a carousel. That means after the first Dialog, the carousel stops working. It's quite a broken experience.
I'm quite sure it's this block of code that's causing the issue: https://github.com/radix-ui/primitives/blob/main/packages/react/use-body-pointer-events/src/useBodyPointerEvents.tsx#L33:L51
Current Behavior
isToolkitOpen: true
isToolkitOpen: false
Expected behavior
Body pointer lock gets removed, maybe with a timeout?
Having to click before you can use your pointer events again is not good UX.
Reproducible example
Not in code, but here's the problem in a screen record.
Screen.Recording.2022-03-09.at.11.52.06.mov
Suggested solution
Remove pointer-events: 'none' immediately after closing the dialog?
Additional context
There's no issue if I close the dialog with ESC or other keyboard interaction. Only on tap. Mouse events work just fine too.
Your environment
The text was updated successfully, but these errors were encountered: