fix(core): ignore minor drag movements when marking aborted drag

This commit is contained in:
braks
2024-07-09 02:07:26 +02:00
committed by Braks
parent 22ad05d63c
commit dab5ab4bbf

View File

@@ -217,6 +217,9 @@ export function useDrag(params: UseDragParams) {
if (distance > nodeDragThreshold.value) {
startDrag(event, nodeEl)
}
// we have to ignore very small movements as they would be picked up as regular clicks even though a potential drag might have been registered as well
dragAborted = distance >= 0.5 && distance < nodeDragThreshold.value
}
// skip events without movement
@@ -225,8 +228,6 @@ export function useDrag(params: UseDragParams) {
mousePosition = getEventPosition(event.sourceEvent, containerBounds!)
updateNodes(pointerPos)
} else {
dragAborted = true
}
}