From e3a96eff8df2397b01c180351bb85b60911e4b54 Mon Sep 17 00:00:00 2001 From: Sarah Hale Date: Thu, 2 Jul 2015 15:34:11 -0700 Subject: [PATCH] [Browse] Fixed clicking on menu Previously any click on the context menu would close the context menu rather than doing the appropriate action. This is now fixed. The menu only closes when a click happens not on the menu. #33. --- platform/representation/src/actions/ContextMenuAction.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/platform/representation/src/actions/ContextMenuAction.js b/platform/representation/src/actions/ContextMenuAction.js index ff31b9f088..ee85b2f900 100644 --- a/platform/representation/src/actions/ContextMenuAction.js +++ b/platform/representation/src/actions/ContextMenuAction.js @@ -92,7 +92,12 @@ define( // Add the menu to the body body.append(menu); - + + // Stop propagation so that clicks on the menu do not close the menu + menu.on('mousedown', function (event) { + event.stopPropagation(); + }); + // Dismiss the menu when body is clicked elsewhere // ('mousedown' because 'click' breaks left-click context menus) body.on('mousedown', dismiss);