diff --git a/src/renderer/menu/input-methods/pointer-input.ts b/src/renderer/menu/input-methods/pointer-input.ts index 059e2d23..b4c58aaa 100644 --- a/src/renderer/menu/input-methods/pointer-input.ts +++ b/src/renderer/menu/input-methods/pointer-input.ts @@ -195,8 +195,15 @@ export class PointerInput extends InputMethod { event.preventDefault(); event.stopPropagation(); - // Ignore right mouse button events. + // Go back or hide the menu on right click events. if ((event as MouseEvent).button === 2) { + this.closeCallback(); + return; + } + + // Go back using the mouse back button. + if ((event as MouseEvent).button === 3) { + this.selectCallback(this.pointerPosition, SelectionType.eParent); return; } @@ -229,18 +236,6 @@ export class PointerInput extends InputMethod { this.gestureDetector.reset(); - // Go back using the mouse back button. - if ((event as MouseEvent).button === 3) { - this.selectCallback(this.pointerPosition, SelectionType.eParent); - return; - } - - // Go back or hide the menu on right click events. - if ((event as MouseEvent).button === 2) { - this.closeCallback(); - return; - } - const clickSelection = this.buttonState === ButtonState.eClicked; // Do not trigger marking-mode selections on the center item.