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:
@@ -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)
|
||||||
@@ -228,6 +228,12 @@ export function useDrag(params: UseDragParams) {
|
|||||||
|
|
||||||
const eventEnd = (event: UseDragEvent) => {
|
const eventEnd = (event: UseDragEvent) => {
|
||||||
if (!dragStarted) {
|
if (!dragStarted) {
|
||||||
|
const node = findNode(id)
|
||||||
|
|
||||||
|
if (node) {
|
||||||
|
emits.nodeClick({ node, event: event.sourceEvent })
|
||||||
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user