Join the Webstudio community

Updated 2 months ago

Closing sheet overlay when link to current page is selected

At a glance

The community member has a minor issue with a site they are building. They have a sheet overlay acting as a navigation menu on mobile, and when moving between pages, it works perfectly. However, when a link to the current page is selected, the sheet overlay does not close, which feels unresponsive. The community member is looking for a clean workaround for this issue, or whether they should manually invoke the click() event on the close button using JavaScript.

In the comments, a community member mentions a workaround, and another community member responds positively, saying "Wonderful, thank you!".

Useful resources
I have a very minor issue with a site I'm putting together, but it's annoying enough to me that I'm hellbent on finding a fix for it. I have a sheet overlay acting as a nav menu on mobile. It contains links to all the pages on the site. When moving between pages, it works perfectly. The issue occurs when a link to the current page is selected. I'd like the sheet overlay to be closed, but currently nothing happens, which feels very unresponsive. Is there a clean workaround for this, or is my best option to manually invoke click() on the close button with a little bit of embedded JS?
Add a reply
Sign up and join the conversation on Discord