From 47d0b1e675a8a0d51253f55962db15c4c1e82c49 Mon Sep 17 00:00:00 2001 From: James Lyne Date: Mon, 24 May 2021 21:07:31 +0100 Subject: [PATCH] Close context menu on map interactions --- src/components/map/MapContextMenu.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/map/MapContextMenu.vue b/src/components/map/MapContextMenu.vue index 8debf76..e9d87e9 100644 --- a/src/components/map/MapContextMenu.vue +++ b/src/components/map/MapContextMenu.vue @@ -124,6 +124,9 @@ export default defineComponent({ window.removeEventListener('keyup', handleEsc); }); + props.leaflet.on('movestart', closeContextMenu); + props.leaflet.on('zoomstart', closeContextMenu); + props.leaflet.on('contextmenu', (e: LeafletMouseEvent) => { e.originalEvent.stopImmediatePropagation(); e.originalEvent.preventDefault();