-
Notifications
You must be signed in to change notification settings - Fork 230
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should call preventDefault on touchstart events #477
Comments
Is this related to Stop Propagation on close? I had an issue with the close button on top of an interactive element underneath the modal, which was getting triggered by the click of the close button |
this was triggering any underlying elements
It does look like #475 is describing the same issue. |
It is not uncommon to have clickable elements underneath a modal overlay that triggers a modal close. When using the
awaitCloseAnimation
option, it is possible for a modal close element to move from under the cursor which can trigger a click on any element underneath it on mobile browsers that emulateclick
events aftertouchstart
events.This problem can be reproduced here on mobile or by using your browser's mobile emulator:
https://pt4fc.csb.app/
To prevent this,
preventDefault
should be called on thetouchstart
event in event handlers. MDN also suggests this to prevent emulated clicks from being heard after atouchstart
event listener has already fired.The text was updated successfully, but these errors were encountered: