# Hamburger menu template: close menu when child item is clicked

**URL:** https://forum.builder.io/t/hamburger-menu-template-close-menu-when-child-item-is-clicked/3767
**Category:** Technical Questions
**Created:** [June 23, 2023, 5:52pm UTC](https://forum.builder.io/t/hamburger-menu-template-close-menu-when-child-item-is-clicked/3767 "2023-06-23T17:52:42Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jakechambers](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@jakechambers](https://forum.builder.io/u/jakechambers)
#### Post date: [June 23, 2023, 5:52pm UTC](https://forum.builder.io/t/hamburger-menu-template-close-menu-when-child-item-is-clicked/3767/1 "2023-06-23T17:52:42Z")

</div>

**Builder content link**

> **[Builder.io: Drag & Drop Headless CMS](https://builder.io/content/3b3730eacc6a4bb09600e749834bfd95)**
>
> Drag and drop with your components, right within your existing site or app. Build and optimize digital experiences for any tech stack, visually..

**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**

 ![Screenshot 2023-06-23 at 1.51.47 PM](https://us1.discourse-cdn.com/flex020/uploads/builder/original/2X/6/626401e9034d66807ba75f6e7064ea0faf1379f9.png)

**Code stack you are integrating Builder with**  
NextJS

**Reproducible code example**  
N/A

---

<div class="post-metadata">

### Author: ![manish-sharma](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@manish-sharma](https://forum.builder.io/u/manish-sharma)
#### Post date: [June 23, 2023, 6:15pm UTC](https://forum.builder.io/t/hamburger-menu-template-close-menu-when-child-item-is-clicked/3767/2 "2023-06-23T18:15:08Z")

</div>

Hello @jakechambers,

Welcome to the [builder.io](http://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](https://www.loom.com/share/6b0d6c810faa4caaab606f8b08ab59e4?sid=62bb4ccc-4990-4368-a0ad-fb0c03228712)

Hope this helps!

---

<div class="post-metadata">

### Author: ![jakechambers](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@jakechambers](https://forum.builder.io/u/jakechambers)
#### Post date: [June 23, 2023, 6:26pm UTC](https://forum.builder.io/t/hamburger-menu-template-close-menu-when-child-item-is-clicked/3767/3 "2023-06-23T18:26:46Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![manish-sharma](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@manish-sharma](https://forum.builder.io/u/manish-sharma)
#### Post date: [June 23, 2023, 6:33pm UTC](https://forum.builder.io/t/hamburger-menu-template-close-menu-when-child-item-is-clicked/3767/4 "2023-06-23T18:33:31Z")

</div>

Hello @jakechambers,

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