Merge pull request #1419 from umap-project/stop-drag

Prevent dragging a datalayer to activate drag on the map
This commit is contained in:
Yohan Boniface 2023-11-26 21:59:16 +01:00 committed by GitHub
commit ab2bb6bb5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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