Hamburger menu template: close menu when child item is clicked

Builder content link

Builder public api key
fbf40af7219745d1a115b63d1c3582b3

What are you trying to accomplish
I am using the hamburger menu template and it works great. One problem I’m having is that when you click an item within the hamburger menu, the menu does not dismiss. This is a very undesirable UX, especially on mobile. It forces the user to make a selection, then press ‘X’.

Screenshots or video link

Code stack you are integrating Builder with
NextJS

Reproducible code example
N/A

Hello @jakechambers,

Welcome to the builder.io forum.

To dismiss the hamburger menu when the navigation item is selected, you will need to add a click event binding to the navigation item, then select the custom code option and add the following code state.hamburgerMenuActive = false

For reference, I’ve recorded a loom video that you can refer to at the below link Loom | Free Screen & Video Recording Software | Loom

Hope this helps!

Hi @manish-sharma! Thank you so much for your help. That Loom video is a recording of the wrong screen, all I see is slack!

Hello @jakechambers,

Apologies for that, please find the correct loom video at the below link