Skip to content

Commit

Permalink
fix: remove trigger of onClick from contextmenu handler (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesLMilner authored May 14, 2024
1 parent 85da1b8 commit a43bc0f
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/adapters/common/base.adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,22 +272,6 @@ export abstract class TerraDrawBaseAdapter implements TerraDrawAdapter {

// We do not want the context menu to open
event.preventDefault();

if (
this._dragState === "not-dragging" ||
this._dragState === "pre-dragging"
) {
const drawEvent = this.getDrawEventFromEvent(event);
if (!drawEvent) {
return;
}

// On mobile devices there is no real 'right click'
// so we want to make sure the event is genuine in this case
if (drawEvent.button !== "neither") {
this._currentModeCallbacks.onClick(drawEvent);
}
}
},
register: (callback) => {
const mapElement = this.getMapEventElement();
Expand Down

0 comments on commit a43bc0f

Please sign in to comment.