Skip to content

Commit

Permalink
🔧 Go back on pointer-down event
Browse files Browse the repository at this point in the history
  • Loading branch information
Schneegans committed Oct 25, 2024
1 parent 0c7374f commit 56d4d71
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions src/renderer/menu/input-methods/pointer-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 56d4d71

Please sign in to comment.