Closed lukeheckman closed 2 years ago
The operation of updateTargetBindings does not conduct a transaction. It is just a way of evaluating some bindings.
Did you call updateTargetBindings within a transaction and without making any other changes to model or diagram that got recorded in the UndoManager? You could do something like myDiagram.commit(diag => {...}, null)
or myDiagram.model.commit(mod => {...}, null)
if you want to commit a transaction that skips recording in the UndoManager. The second argument of null tells it to perform the whole transaction with skipsUndoManager set to false.
updateTargetBindings adds an empty step in the
undoManager
with an empty transaction name. Undoing or redoing will result in an extra step as well where no visual changes occur (e.g. Having to undo three times instead of two to revert a model's relinking steps).To fix this, I implemented a workaround using
skipsUndoManager
whenever callingupdateTargetBindings
to reach the intended behavior.