diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js index c57ad350e34..95b28aee882 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js @@ -1217,6 +1217,7 @@ const Wysiwyg = Widget.extend({ } } else { const historyStepIndex = this.odooEditor.historySize() - 1; + this.odooEditor.historyPauseSteps(); let { link } = Link.getOrCreateLink({ containerNode: this.odooEditor.editable, startNode: options.link, @@ -1241,6 +1242,7 @@ const Wysiwyg = Widget.extend({ data.rel = 'ugc'; } linkWidget.applyLinkToDom(data); + this.odooEditor.historyUnpauseSteps(); this.odooEditor.historyStep(); link = linkWidget.$link[0]; this.odooEditor.setContenteditableLink(linkWidget.$link[0]); @@ -1255,6 +1257,7 @@ const Wysiwyg = Widget.extend({ Promise.resolve().then(() => link.focus()); }); linkDialog.on('closed', this, function () { + this.odooEditor.historyUnpauseSteps(); // If the linkDialog content has been saved // the previous selection in not relevant anymore. if (linkDialog.destroyAction !== 'save') {