Dragging group breaks the links contained in that group on subsequent copy / paste


We’re having issues with groups where drag / drop actions seem to put our links in some bad state that is not held in a transactions (not remedied by doing a rollback). Once that group is in a bad state any copy paste action of the group in question ends up having links all over the place as can be seen in my attached gif.


I’m sorry, but I do not see anything wrong with the links. Could you please describe the problem in more detail? What are your node and group and link templates?

Basically this only happens when the user drags a group that contains linked items. I can do a regular copy paste of that same group without seeing the attached issue.

Precisely which version of GoJS are you using? What you describe sounds familiar – as a bug that we fixed long ago, in 2.2.14.

“gojs”: “2.3.4”,

I don’t know what to say. The bug that we fixed was to customize the DraggingTool so that layouts are not performed during the drag, despite the value of Layout.isRealtime.

Is there any way that we could reproduce the problem?

So to add on to my original explanation, I forgot to mention we’re using a custom dragging tool that’s based off your NonRealTimeDraggingTool example. So in other words as soon as the “doActivate” is called we’re then creating an image part on the tool layer to prevent any kind of redraw or performance implications to either move or copy the object you’re dragging. The action of dragging that group without performing a move operation results in the group’s links being broken.

I’m curious if there is a problem if you don’t install your custom DraggingTool.

I tried a sample that exhibited the bug in old versions of GoJS that no longer does in newer versions of GoJS, and I replaced the standard DraggingTool with an instance of the NonRealtimeDraggingTool extension.

It worked well, and I was unable to produce any problem no matter how I changed the configuration of various properties that might have had an effect.

How I can reproduce your problem?

this only happens when dragging a group with multiple objects inside and then trying to copy that group into itself after a drag operation was initiated. I wonder if there’s a way to force redraw links in that group only if the user cancels the drag action. If the user completes the move then the links are redrawn upon move so the issue is non existent.

I added a Group.mouseDrop event handler to add the Diagram.selection as members of the group. I still cannot produce any problem whether I allow the drop to happen, if I drag in and out, if I cancel the drag, if I turn on and off copying (by pressing and releasing the Ctrl key), and all kinds of combinations.