Hey there,
I’ve noticed that the usability of my mobile page isn’t optimal. When the user opens the nav bar menu, it can only be closed by pressing the exact same icon. However, it would be more intuitive if it would close when tapping outside of the overlay.
How do I achieve this?
Here is an image, and the arrow shows where a touch should trigger the nav overlay to close.
Add a click trigger on the background overlay and set it to close the menu , basically the same interaction you’re using on the icon, just applied to the overlay div. Did this on a client’s mobile nav and it makes the UX feel way smoother.
That makes a lot of sense, can you help me finding this element? I’ve been trying for half a day to make it work but I just can’t find it. Is the the “mobile navigation shade”?
You can probably solve this use-case by selecting ‘Tablet’ breakpoint and setting the Nav Menu element’s height to ‘Auto’ as highlighted in the screenshot below:
This should close the menu if a user clicks on the overlay that is displayed in tablet and mobile breakpoints and also take care of the menu icon animation in that case.
This is awesome! Thank you so much! I managed to implement it with your screenshots.
There is only one thing that happens now. If the user clicks the hamburger icon twice, the menu closes, but the overlay stays, and it only disappears if they click on it.
Is there a way to ensure that the shade is also completely removed when the user clicks the icon twice?
I can see that Mouse navigation shade element has an interaction enabled named ‘Close flyout menu’. Is there a reason why you are not linking the ‘Close mobile menu’ interaction to it instead?
I believe this interaction is causing some issues when the overlay is clicked since its not consistent with the elements that are visible on the tablet breakpoint and is causing some unexpected behavior.
When I apply the ‘Close mobile menu’ interaction to the shade element, even when I click on the overlay shade the menu closes and the shade disappears as you would expect it to as per the design.
Yep, Webflow doesn’t like when different elements reference separate close animations. One global “Close mobile menu” interaction keeps everything in sync.