Issue when copying a collection with non-copyable node

Hello,

two questions regarding this example (the Delta node is set to copyable=false):
https://codepen.io/dominic-simplan/pen/dyobOpQ?editors=1010

  1. If I select all elements, copy all using Ctrl+C and paste them using Ctrl+V, the ModelChangedListener receives events about removed links. Why? The data is copied, so I shouldn’t get a remove event? I assume internally the links of the non-coypable nodes are removed, but this shouldn’t trigger a ModelChangedEvent as this is not a change I would expect to occur on my model if I copy something?

  2. If I select all elements, and copy them by pressing Ctrl and dragging them using the mouse, exeptions are logged in the console: TypeError: a.diagram is null

For #2, that’s just a bug. Thanks for reporting it – we’ll fix it in 2.1.8, which might come out in the next couple days.

#1 will require some more thought as to what should be “correct” and what should be “right” and what should be “good”.
EDIT: What is happening is that in the first pass all Parts for which Part.canCopy returns true are copied. Then in the second pass it realizes that some links were copied but that those new links are now dangling because the non-copyable node was not copied, so it removes those copied links.