mirror of
https://github.com/laurent22/joplin.git
synced 2024-11-24 08:12:24 +02:00
Plugins: Make sure "replaceSelection" command can be undone in Rich Text editor
This commit is contained in:
parent
ce59d29bb3
commit
b480aae59b
@ -275,6 +275,12 @@ const TinyMCE = (props: NoteBodyEditorProps, ref: any) => {
|
||||
editor.selection.setContent(value);
|
||||
editor.fire('joplinChange');
|
||||
dispatchDidUpdate(editor);
|
||||
|
||||
// It doesn't make sense but it seems calling setContent
|
||||
// doesn't create an undo step so we need to call it
|
||||
// manually.
|
||||
// https://github.com/tinymce/tinymce/issues/3745
|
||||
window.requestAnimationFrame(() => editor.undoManager.add());
|
||||
},
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user