Bug(?): ChangedEvent Insert firing without inserting into model


Not sure if this is a bug or intended behaviour.
Context: a diagram (right) and a palette (left) that enables drag-and-drop of nodes into the diagram.

Bug: drag-and-dropping a node from the palette will trigger a ChangedEvent Insert as soon as the node is dragged over the diagram (without dropping). The model doesn’t update at this state yet. I can keep dragging the node back and forth between the palette and diagram to keep triggering events without any model change.

Dropping the node on the diagram triggers another ChangedEvent Insert, and also actually updates the model.

Is this intended behaviour? If so, the documentation is unclear what event to listen to when a node is actually added to the model.

That is intended behavior – during a drag it creates temporary parts, so the changes are not recorded in the Model or UndoManager. The Insert ChangedEvent should be of the Diagram, not the Model. And there should be matching Remove ChangedEvents for the Diagram.

Are you checking ChangedEvent.model to see if it’s a change to a model?