From 7ae15239b1c9d71e4dc1bdf409116f9f5c115d52 Mon Sep 17 00:00:00 2001 From: Davide Passoni Date: Wed, 26 Mar 2025 10:24:46 +0100 Subject: [PATCH] fix: Context menu shown when dragging handles --- .../map/coalitionarea/coalitionareahandle.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/frontend/react/src/map/coalitionarea/coalitionareahandle.ts b/frontend/react/src/map/coalitionarea/coalitionareahandle.ts index 3bc95b63..aa3b77c9 100644 --- a/frontend/react/src/map/coalitionarea/coalitionareahandle.ts +++ b/frontend/react/src/map/coalitionarea/coalitionareahandle.ts @@ -1,4 +1,4 @@ -import { DivIcon, LatLng } from "leaflet"; +import { DivIcon, DomEvent, LatLng } from "leaflet"; import { CustomMarker } from "../markers/custommarker"; export class DraggableHandle extends CustomMarker { @@ -8,6 +8,22 @@ export class DraggableHandle extends CustomMarker { this.on("add", (e) => { this.getElement()?.addEventListener("touchstart", (e) => e.stopPropagation()); }); + + this.on("mousedown", (e) => { + DomEvent.stopPropagation(e); + }); + + this.on("mouseup", (e) => { + DomEvent.stopPropagation(e); + }); + + this.on("dragstart", (e) => { + DomEvent.stopPropagation(e); + }); + + this.on("dragend", (e) => { + DomEvent.stopPropagation(e); + }); } createIcon() {