fix: Context menu shown when dragging handles

This commit is contained in:
Davide Passoni
2025-03-26 10:24:46 +01:00
parent 589479ba56
commit 7ae15239b1

View File

@@ -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() {