Don't show context menu when right-clicking controls
This commit is contained in:
parent
e1351d566a
commit
54742f90f9
@ -153,6 +153,11 @@ export default defineComponent({
|
|||||||
props.leaflet.on('zoomstart', closeContextMenu);
|
props.leaflet.on('zoomstart', closeContextMenu);
|
||||||
|
|
||||||
props.leaflet.on('contextmenu', (e: LeafletMouseEvent) => {
|
props.leaflet.on('contextmenu', (e: LeafletMouseEvent) => {
|
||||||
|
//Ignore right-clicks on controls
|
||||||
|
if(e.originalEvent.target && (e.originalEvent.target as HTMLElement).closest('.leaflet-control')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
e.originalEvent.stopImmediatePropagation();
|
e.originalEvent.stopImmediatePropagation();
|
||||||
e.originalEvent.preventDefault();
|
e.originalEvent.preventDefault();
|
||||||
event.value = e;
|
event.value = e;
|
||||||
|
Loading…
Reference in New Issue
Block a user