fix(core): emit node click event when drag was ended with no movement (#1522)

* fix(core): emit node click event when drag was ended with no movement

* chore(changeset): add
This commit is contained in:
Braks
2024-07-08 22:16:12 +02:00
parent 45c59612f3
commit 4548021b74
2 changed files with 11 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
---
"@vue-flow/core": patch
---
Emit `nodeClick` event when a node is dragged without exceeding the node drag threshold (i.e. no visible movement has happened)

View File

@@ -228,6 +228,12 @@ export function useDrag(params: UseDragParams) {
const eventEnd = (event: UseDragEvent) => {
if (!dragStarted) {
const node = findNode(id)
if (node) {
emits.nodeClick({ node, event: event.sourceEvent })
}
return
}