undo
The functionality is available in PRO Edition only
PROReverts the board to the state before the last mutating action. Requires history={true} on the <Kanban> component. Does nothing when the undo stack is empty or history is disabled.
Mutating actions that push history snapshots: add-card, update-card, move-card, duplicate-card, delete-card.
Usage
type UndoPayload = {};
Empty payload - no parameters needed.
Trigger
api.exec("undo", {});
Observe
api.on("undo", () => {
console.log("undo applied");
});
Intercept
api.intercept("undo", () => {
// return false to prevent undo
return true;
});
Component handler
<Kanban cards={cards} columns={columns} history={true} onUndo={() => console.log("undone")} />
Related
- Undo and redo guide - enabling history and toolbar integration
- redo - re-apply the last undone change
- history - enables undo/redo snapshots
- Toolbar - built-in undo/redo buttons