From 0c99bc45a83fbac4e3d1451c220a118fac78d0e4 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Thu, 23 Nov 2023 10:00:02 +0100 Subject: [PATCH] Prevent dragging a datalayer to activate drag on the map --- umap/static/umap/js/umap.core.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/umap/static/umap/js/umap.core.js b/umap/static/umap/js/umap.core.js index 391ec2e6..02384ec0 100644 --- a/umap/static/umap/js/umap.core.js +++ b/umap/static/umap/js/umap.core.js @@ -698,12 +698,14 @@ L.U.Orderable = L.Evented.extend({ }, onDragOver: function (e) { + L.DomEvent.stop(e) if (e.preventDefault) e.preventDefault() // Necessary. Allows us to drop. e.dataTransfer.dropEffect = 'move' return false }, onDragEnter: function (e) { + L.DomEvent.stop(e) // e.target is the current hover target. const dst = this.findTarget(e.target) if (!dst || dst === this.src) return