diff --git a/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js b/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js index 8d512de86c5..73fc5159a9a 100644 --- a/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js +++ b/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js @@ -1923,14 +1923,14 @@ export class OdooEditor extends EventTarget { setContenteditableLink(link) { const editableChildren = link.querySelectorAll('[contenteditable=true]'); - this._stopContenteditable(); - this._fixLinkMutatedElements = { link, wasContenteditableTrue: [...editableChildren], wasContenteditableFalse: [], wasContenteditableNull: [], }; + this._stopContenteditable(); + const contentEditableAttribute = link.getAttribute('contenteditable'); if (contentEditableAttribute === 'true') { this._fixLinkMutatedElements.wasContenteditableTrue.push(link); diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js index 216dc451c88..600314e6427 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js @@ -3201,7 +3201,8 @@ export class Wysiwyg extends Component { * @param {Node} node */ _onPostSanitize(node) { - if (node?.querySelectorAll) { + // _fixLinkMutatedElements check to be removed after the new link edge soltion is merged. + if (node?.querySelectorAll && this.odooEditor && !this.odooEditor._fixLinkMutatedElements) { for (const element of node.querySelectorAll('.o_editable, .o_not_editable')) { const editable = element.classList.contains('o_editable'); if (element.isContentEditable !== editable) {