Skip to content

Is there any onSelectionChange event like react flow in vueflow? #1359

Answered by bcakmakoglu
Genuifx asked this question in Q&A
Discussion options

You must be logged in to vote

No, you can just create your own watcher + getSelectedNodes / getSelectedEdges.
There's currently no hook like useOnSelectionChange, maybe I'll add it for v2.

const { getSelectedNodes, getSelectedEdges } = useVueFlow()

watch([getSelectedNodes, getSelectedEdges], ([nextNodes, nextEdges]) => {
	// do something when selected nodes/edges changed
})

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Genuifx
Comment options

Answer selected by Genuifx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants