Skip to content

Commit

Permalink
Re-open context menu immediately when different bundle is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
bregenspan committed Apr 8, 2019
1 parent d9c96a3 commit 83adbbb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion client/components/ContextMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,15 @@ export default class ContextMenu extends PureComponent {
this.hide();
}

/**
* Handle document-wide `mousedown` events to detect clicks
* outside the context menu.
* @param {MouseEvent} e - DOM mouse event object
* @returns {void}
*/
handleDocumentMousedown = (e) => {
if (elementIsOutside(e.target, this.node)) {
const isSecondaryClick = e.ctrlKey || e.button === 2;
if (!isSecondaryClick && elementIsOutside(e.target, this.node)) {
e.preventDefault();
e.stopPropagation();
this.hide();
Expand Down

0 comments on commit 83adbbb

Please sign in to comment.