X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/e6d69724ebd2256128e983d4a95bd1d46dd71592..e8d0331277033fea37a9fd73ffc781ffca8759f0:/src/components/context-menu/context-menu.tsx

diff --git a/src/components/context-menu/context-menu.tsx b/src/components/context-menu/context-menu.tsx
index 48e63ba0..c892ba26 100644
--- a/src/components/context-menu/context-menu.tsx
+++ b/src/components/context-menu/context-menu.tsx
@@ -28,7 +28,8 @@ export default class ContextMenu<T> extends React.PureComponent<ContextMenuProps
             open={!!anchorEl}
             onClose={onClose}
             transformOrigin={DefaultTransformOrigin}
-            anchorOrigin={DefaultTransformOrigin}>
+            anchorOrigin={DefaultTransformOrigin}
+            onContextMenu={this.handleContextMenu}>
             <List dense>
                 {actions.map((group, groupIndex) =>
                     <React.Fragment key={groupIndex}>
@@ -49,4 +50,9 @@ export default class ContextMenu<T> extends React.PureComponent<ContextMenuProps
             </List>
         </Popover>;
     }
+
+    handleContextMenu = (event: React.MouseEvent<HTMLElement>) => {
+        event.preventDefault();
+        this.props.onClose();
+    }
 }
