Issue #2556✓ SolvedOpened February 8, 2020by MatthewMariner4 reactions

Limit UndoManager to X amount of steps

Quick answerby artf4

Read full answer below ↓

Question

Use Case: Hey guys, I looked through the UndoManager API/Searched for issues - but I am unable to figure out how to limit the UndoManager. If I create a robust website and spend 30 minutes making it, it looks like I can ctrl + z all the way back to start. I'm thinking this could possibly slow down the Editor since it saves all these steps in the Undo Manager.

TLDR So, does anyone know how to limit the UndoManager to only save X amount of steps?

Answers (2)

👍 Most helpfulartfFebruary 13, 2020
editor.UndoManager.getInstance().set('maximumStackLength', 100);
MatthewMarinerFebruary 14, 2020

Thank you @artf

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.