Undo redo in JavaScript Block Editor control
18 Nov 20181 minute to read
The undo/redo feature in Block Editor enables users to revert or reapply changes made to the content, offering a safety net for edits and enhancing the overall editing experience.
Keyboard shortcuts
| Action | Windows | Mac | Description |
|---|---|---|---|
| Undo | Ctrl + Z | ⌘ + Z | Reverts the last action. |
| Redo | Ctrl + Y | ⌘ + Y | Reapplies the last undone action. |
Configuring Undo/Redo stack
The Block Editor stores a history of actions, allowing users to perform undo and redo operations. By default, it saves up to 30 actions. You can customize this limit using the undoRedoStack property to control the maximum number of steps that can be undone or redone.
The example below sets the undo/redo history limit to 20 actions.