[Question] Limit UndoManager to X amount of steps
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)
editor.UndoManager.getInstance().set('maximumStackLength', 100);
Thank you @artf
Related Questions and Answers
Continue research with similar issue discussions.
Issue #358
Calling updateScript from the script section of a pluging
Hi guys, I've been stuck for a few hours trying to figure out how to call updateScript from the script section of a custom plugin. So far I...
Issue #769
Need further info to create backend for Asset Manager
I'm trying to figure out how to write a backend (in ASP.NET Core) for the Asset Manager. I've looked at a few of the Wiki pages, but still...
Issue #2512
[Question] GrapesJS in a VueJS app
I'm building a VueJS app and would like to use GrapesJS inside the app (and I'm NOT trying to use VueJS inside GrapesJS). I've searched and...
Issue #2279
[QUESTION]: How to update the model for a custom component when a trait is changed.
Hi! I have read and re-read the GrapesJS Docs and API Reference on how to create a custom component and I just can't seem to figure it out....
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.