Join the Webstudio community

Updated 3 months ago

Close Mobile Menu Overlay on clicking an anchor link

At a glance
I'm using Radix Mobile Menu component.
On Mobile, when tapping on the hamburger menu icon, the sheet overlay appears. I'd like to achieve that this overlay closes when tapping on an anchor link inside the nav menu contained in this sheet. As of now the browser does navigate to that particular anchor on clicking such links, but the sheet overlay is still visible and hides the content behind it.

Of course this only applies to anchor link on the same page, as link to new pages do close the overlay since a new page is loaded.

What's the simplest way to do that?

Thanks for your help!
s
J
A
3 comments
Thank you @John Siciliano, it works perfectly!
Add a reply
Sign up and join the conversation on Discord