Issue #700Opened January 2, 2018by krunal0390 reactions

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)

ryandebaJanuary 2, 20180 reactions

Hi @krunal039,

You probably want to clear out the undo history right after populated your content from the db.

editor.UndoManager.clear();

krunal039January 2, 20180 reactions
Code SnippetTEXT
@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)"
      }
    }`
ryandebaJanuary 2, 20180 reactions

@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.

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...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.