Undo Issues after upgrading to gojs version 1.8.16 from 1.6.17

Hi GoJS team,

In our application we use ready-made diagrams which we can drag and drop on the Canvas directly from the palette. The diagram may include nodes as well as groups.
Before we upgraded gojs to 1.8.16 from 1.6.17 when we dragged and dropped a “diagram**” from the palette, one transaction was triggered ExternalCopy and on CTRL-Z it will take away the entire diagram at once (undo of ExternalCopy transaction), but post upgrade, we are getting two transactions: (i)Layout and (ii) ExternalCopy.So because of this, on the first CTRL-Z it is removing the grouping elements( ungrouping the node elements on first undo) from the dropped diagram and on the second CTRL-Z it is removing the nodes(elements within), which means we need to trigger undo twice(two CTRL-Z) in this case in order to remove the entire diagram from the canvas.

Would you help us understand the reason for this second Transaction - Layout on diagram drop and also help us find a solution where we can remove the diagram from the Canvas on a single Undo Call.

We have tried the below mentioned ways so far:

  1. skipsEvent function- to skip Layout transaction.
  2. Trigger diagram.undoManager.undo() to undo Layout transaction.
  3. diagram.skipsUndoManager function - to skip Layout Transaction.

Could you explain what happens when the user drag-and-drops a diagram into a diagram?

What do you mean by ExternalCopy?