mouseDrop behavior

Hi all,

I’m trying to return the node to it’s original position if it was dropped in a blank area of the diagram.
I spent some time looking the API for an event where I can do this after the user drop the node:

  • mouseDragEnter: do the things while I’m still pressing the button;
  • mouseDragLeave: like the first one;
  • mouseDrop: is triggered just if i leave the object inside other node.

I thought that mouseDrop must be triggered every time you drop an object. If you drop outside other node then you don’t have <span =“light”>GraphObject parameter, if you drop inside it has a value.
Are there some event that have this behavior? Or some way to invalidate drops outside other node?

If the user is dropping onto the background of the diagram, i.e. not on a Part, then the Diagram.mouseDrop event handler is called. So you could do something like: myDiagram.mouseDrop =<span style="line-height: 1.4;"> function(e) {myD</span><span style="line-height: 1.4;">iagram.currentTool.doCancel();</span><span style="line-height: 1.4;"> }

Thanks Walter. Works perfectly!