-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Navigation Block mobile menu modal doesn't close #35686
Comments
I was also running into issues with this on a company theme I was working on. Found that this is due to the MicroModal package using touchstart. There is an open issue for this in the MicroModal repo suggesting to call preventDefault on touchstart events. ghosh/Micromodal#477 |
Created a PR (ghosh/Micromodal#479) that fixes ghosh/Micromodal#477 Also attempted to contact one of the maintainers of the project. Since it is a dependency, what happens if that package does not get updated? The last commit on the master was Mar 26, 2020. |
I also ran into the same issue... |
A fix has been merged in Micromodal v0.4.7 |
I'm going to close this out as I can't replicate with WordPress 5.9, TT2, and Gutenberg 12.5.3: clos.modal.movThank you @bgoewert for jumping in with a PR above 🥳 If anyone else can replicate still, please just comment here and I'll re-open. |
Description
The mobile menu modal doesn't stay closed after clicking the close icon when the hamburger menu icon is directly underneath the modal's close icon.
AFAICT, the reason is that the modal closes on
touchstart
which exposes the hamburger menu icon underneath and thetouchend
when releasing the mouse button triggers a click on the hamburger menu icon which then opens the menu again.A local fix of adding preventDefault to the
touchstart
event before callingcloseModal
in theonClick
method fixes the issue.Alternatively, change triggering the onClick method from
touchstart
event to aclick
event instead.Hope that helps!
Step-by-step reproduction instructions
Enable responsive menu
option is selected and a menu with menu items is selectedScreenshots, screen recording, code snippet
The first two clicks on the close icon show the issue as described above in steps 9-10. The two clicks after show steps 12-16.
Environment info
WordPress 5.8.1
Gutenberg 11.7
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: