jerosoler / Drawflow

Simple flow library 🖥️🖱️
https://jerosoler.github.io/Drawflow/
MIT License
4.65k stars 722 forks source link

Dragging node without selecting the node #481

Closed gpack closed 2 years ago

gpack commented 2 years ago

Is it possible to drag a node, but don't select it? I would like the user to be able to select a node only when they click on the node (single click), but not while they are dragging it.

Currently I am detecting "dragging" of node using below code: if(editor.node_selected && editor.drag) { // dragging node } But if I unselect the node when they start dragging, the "nodeSelected" event still executes. So I can't place any code in that function because it will always fire when user is dragging the node.

jerosoler commented 2 years ago

Either you create a variable for nodeselect to skip or you can move nodes via javascript.

gpack commented 2 years ago

Ok thanks.