Skip to content

Commit dab5ab4

Browse files
committed
fix(core): ignore minor drag movements when marking aborted drag
1 parent 22ad05d commit dab5ab4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/core/src/composables/useDrag.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ export function useDrag(params: UseDragParams) {
217217
if (distance > nodeDragThreshold.value) {
218218
startDrag(event, nodeEl)
219219
}
220+
221+
// 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
222+
dragAborted = distance >= 0.5 && distance < nodeDragThreshold.value
220223
}
221224

222225
// skip events without movement
@@ -225,8 +228,6 @@ export function useDrag(params: UseDragParams) {
225228
mousePosition = getEventPosition(event.sourceEvent, containerBounds!)
226229

227230
updateNodes(pointerPos)
228-
} else {
229-
dragAborted = true
230231
}
231232
}
232233

0 commit comments

Comments
 (0)