jerosoler / Drawflow

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

How to find if user is moving the selected node around #737

Closed capoia closed 11 months ago

capoia commented 11 months ago

Hello, first thanks for the package, it has helped me a lot!

I wanted to know if there is a way to identify when a node is being moved, because I would like that when clicking on the node a config menu opens, but if the user clicks and then starts moving I would like this menu not to be opened.

jerosoler commented 11 months ago

Hi @capoia

With event mousemove

View example:

    editor.on("mouseMove", ({x,y}) => {
        if(editor.node_selected && editor.drag) {
          console.log("Movenode");
        }
    });
capoia commented 11 months ago

Thanks!