# Menu Tree selection closing a popup

**URL:** <https://forum.inductiveautomation.com/t/menu-tree-selection-closing-a-popup/66129>\
**Category:** Ignition\
**Created:** [November 4, 2022, 2:16pm UTC](https://forum.inductiveautomation.com/t/menu-tree-selection-closing-a-popup/66129 "2022-11-04T14:16:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan\_Hansen](https://avatars.discourse-cdn.com/v4/letter/r/7bcc69/32.png) [@Ryan\_Hansen](https://forum.inductiveautomation.com/u/Ryan_Hansen)\
**Post date:** [November 4, 2022, 2:16pm UTC](https://forum.inductiveautomation.com/t/menu-tree-selection-closing-a-popup/66129/1 "2022-11-04T14:16:49Z")

</div>

I have a menu tree as a view I open as a popup. Opening works well but I'd like the menu selection to automatically close the popup. The closest I had was on item clicked event that closed the popup, but any click will close that of course. Trying to get it only when a submenu item is clicked.

---

<div class="post-metadata">

**Author:** ![Drew.Gatti](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/drew.gatti/32/39854_2.png) [@Drew.Gatti](https://forum.inductiveautomation.com/u/Drew.Gatti)\
**Post date:** [November 4, 2022, 2:51pm UTC](https://forum.inductiveautomation.com/t/menu-tree-selection-closing-a-popup/66129/2 "2022-11-04T14:51:51Z")

</div>

Try using an event script on the view itself. Like this:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/d/8ddba001e1d55f23df1fab924773a4dbd95b76b1.png)

When a new screen opens, trigger the popup to close. You'll need to apply this to all your screens in the menu selection.

---

<div class="post-metadata">

**Author:** ![Ryan\_Hansen](https://avatars.discourse-cdn.com/v4/letter/r/7bcc69/32.png) [@Ryan\_Hansen](https://forum.inductiveautomation.com/u/Ryan_Hansen)\
**Post date:** [November 8, 2022, 3:21pm UTC](https://forum.inductiveautomation.com/t/menu-tree-selection-closing-a-popup/66129/3 "2022-11-08T15:21:52Z")

</div>

Thank you
