Skip to content

Commit 19fc003

Browse files
committed
MouseControl onContextMenu: Prevent other elements to handle the event after MouseControl.
* Or map element's contextmenu handler is activated. * Also we need to prevent default there. Signed-off-by: Gökay Şatır <[email protected]> Change-Id: If83d6485beb2a1c4bb36beb9285a3baad8fdd064
1 parent 3137d33 commit 19fc003

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

browser/src/canvas/sections/MouseControl.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ class MouseControl extends CanvasSectionObject {
6767
}
6868

6969
public onContextMenu(point: cool.SimplePoint, e: MouseEvent): void {
70+
// We need this to prevent native context menu.
71+
e.preventDefault();
72+
73+
// We will remove below ones after we remove map HTML element.
74+
e.stopPropagation();
75+
e.stopImmediatePropagation();
76+
7077
const buttons = app.LOButtons.right;
7178
const modifier = this.readModifier(e);
7279
if (modifier === 0) {

0 commit comments

Comments
 (0)