Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Minor change for handleMenuItemClick

See original GitHub issue

There is a simple change which can be made to allow for more dynamic decisions as to whether to hide the header menu for a given command.

In plugins/headerMenu.js

For the handleMenuItemClick function:

hideMenu() is called prior to checking whether there is a command.

This means every time you click a menu option the menu closes.

If you move hideMenu after the if block and wrap it as follows:

if(!e.isDefaultPrevented) {

The result is the menu will only be hidden if a developer doesn’t use e.preventDefault() in the onCommand handler.

onCommand: (e: Event, args: MenuCommandItemCallbackArgs) => {
  // do stuff that will not close the window.

This would also mean a developer’s could decide whether to prevent the default depending on the command that is being handled.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

6paccommented, Mar 16, 2021

thanks @ghiscoding maybe better if you do it…

ghiscodingcommented, Mar 17, 2021

done… and I went further and applied it to all plugins with menu that I found (4 of them) to have such behaviors.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NavigationView handle menu item click - android
How to handle menu item clicks on NavigationView in Main Activity? NavigationView navigationView = findViewById(;. I am using " ...
Read more >
Control whether Menu closes on Menu.Item click #1122 - GitHub
Hi there! I have a use case for the Menu component where I don't necessarily want the Menu to close when I click...
Read more >
How to handle click on a programaticaly added menu item ...
Hello, I am programmatic adding menu items in my application menu (using CMenu->InsertMenuItem). My problem is: how do I tell the app to ......
Read more >
How to handle the Menu Item Click event for the newly added ...
Hi Team, Could you please tell me how to handle the Menu Item Click event for the newly added Context Menu Item. When...
Read more >
Menu - Syntax & Usage - AutoHotkey
The Menu command creates, deletes, modifies and displays menus and menu items, changes the tray icon and its tooltip, or controls whether the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found