-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Dialog onClose executes twice in mobile #2671
Comments
Current workaround, adding onTouchEnd={(e) => {
e.preventDefault();
}} |
I might have found the issue and how to fix it, but I don't know if it's a viable fix. @thecrypticace are you still working on this? If yes, we can talk a bit about it. |
@DavideFrancescon yeah I'm literally chatting with @reinink about this right now 😂 What did you have in mind? I'm curious to know. |
@thecrypticace @reinink I noticed that on mobile both touchEnd and click events get fired, so a workaround was to add a check on the click event with the isMobile function.
I tried testing a yarn test and it gets the same results as before the changes, so if that's to be believed, it should work properly everywhere (hopefully) |
That is a much better solution than what I'd just come up with. Fantastic. Thank you! I'll try to get this taken care of today! |
Happy to be of help, if you want I can do the PR myself and then you can merge it |
@DavideFrancescon that'd be great |
This should be fixed by #2690, and will be available in the next release. You can try it using out insiders build (may take a few minutes to publish):
Thanks for reporting this one. ✨ |
Package & version
@headlessui/react 1.7.16
What browser are you using?
Tried on Chrome, Safari, FireFox
Reproduction URL
Describe your issue
On mobile, when click outside, the
onClose
is fired twice.I've found a related issue & fix #1490, it seems to be still the case on mobile
The text was updated successfully, but these errors were encountered: