Undomanager and ctrl+z/ctrl+y
Question
we load content from db once editor page load and if use select undo after any changes it makes editor canvas blank. Is there way to solve it?
Answers (3)
Hi @krunal039,
You probably want to clear out the undo history right after populated your content from the db.
editor.UndoManager.clear();
@ryandeba I tried and now undo and redo button does not do anything(not even blank editor canvas) I have below code
`[{
id: "undo",
className: "fa fa-undo icon-undo",
command: function command(editor, sender) {
sender.set("active", 0);
editor.UndoManager.undo(1);
},
attributes: {
title: "Undo (CTRL/CMD + Z)"
}
}, {
id: "redo",
className: "fa fa-repeat icon-redo",
command: function command(editor, sender) {
sender.set("active", 0);
editor.UndoManager.redo(1);
},
attributes: {
title: "Redo (CTRL/CMD + Y)"
}
}`@krunal039 Could you create a jsfiddle example that shows the issue? Calling editor.UndoManager.clear() shouldn't completely break the undo/redo functionality, so I suspect there is some other issue going on.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1227
Re-render view in editor's canvas whenever Trait value changes
Is there any possible way in grapesjs that whenever a user changes the value of a Trait of a custom component the render function should li...
Issue #1607
Load 2 canvas
Is there any way to load 2 page canvas with single sidebar drag and drop functionality.?
Issue #1306
Inserting text in an canvas element is not updated on the HTML content after saving it.
H @artf, I have a pitfalls in the middle of saving the HTML content. Right now we have a popup modal dialog where I can select some special...
Issue #1766
Is There any way to integrate ImageEditor in GrapesJs
After Dropping the image inside the editor is there any plugin for GrapesJs to edit that image like Cropping , adding text on it .....
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.