tsdraw tracks document changes so users can undo and redo their actions. The system works by capturing full document snapshots at key moments.Documentation Index
Fetch the complete documentation index at: https://docs.tsdraw.com/llms.txt
Use this file to discover all available pages before exploring further.
Using undo/redo
From the UI, the default toolbar includes undo and redo buttons. Users can also use keyboard shortcuts:- Undo:
Ctrl/Cmd + Z - Redo:
Ctrl/Cmd + Shift + Z
How it works
The editor maintains a stack of document snapshots. Each user action that modifies the document (drawing a shape, erasing, moving) pushes a new snapshot to the stack. When the user undoes an action, the editor restores the previous snapshot. Redo moves forward through the stack.History limits
The history stack is capped at 100 entries. Once the limit is reached, the oldest entry is discarded when a new one is added.Batching
Multiple rapid changes (like dragging to move shapes) are batched into a single undo entry. This means undoing a drag restores the shapes to their position before the drag started, not to each intermediate position.Touch gestures
On mobile and tablet:| Gesture | Action |
|---|---|
| Two-finger tap | Undo |
| Three-finger tap | Redo |
touchOptions: