Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 406266

Summary: [commands] Command menus don't close when menu item is clicked
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: ClientAssignee: Mark Macdonald <mamacdon>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: libingw
Version: 2.0   
Target Milestone: 3.0 M2   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Mark Macdonald CLA 2013-04-22 22:12:54 EDT
I am rendering a command as a list of choices using a "choiceCallback", like this:
> var myCommand = new mCommands.Command({
>   name: "View",
>   tooltip: "Change what to show in the sidebar", // XXXX
>   id: "orion.sidebar.viewmode",
>   visibleWhen: function() { return true; },    
>   choiceCallback: mycallback
> });
> 
> commandRegistry.addCommand( foo ); 
> commandRegistry.registerCommandContribution( ... );
> commandRegistry.renderCommands( ... );

When one of the menu items is clicked, I expected the dropdown to close. However it remains open.
Comment 2 Mark Macdonald CLA 2013-04-23 09:53:51 EDT
I modified the "auto-dismiss" trigger so that clicking a menu item hides the dropdown (unless the menu item is a submenu).

Previously it was excluding the entire _dropdownNode, which meant that if you clicked a menu item, the menu would not be auto-dismissed.