Skip to main content

Undo / Redo

The designer supports undo/redo operations. By default this feature is disabled.

Example

To enable the undo / redo feature you need to set the undoStackSize property in your configuration.

const configuration = {
undoStackSize: 10,
// ...
};

This property sets a limit of undo/redo operations. Be careful with this property. If you set it to a big number it may cause performance issues.

Use stack from previous session

You may initialize the designer with the undo stack from the previous session.

const configuration = {
undoStackSize: 10,
undoStack: myUndoStack,
// ...
};

To read the current stack you should use the dumpUndoStack() method.

const myUndoStack = designer.dumpUndoStack();