diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js index 78de2332aee..2a378e91d9d 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js @@ -736,7 +736,7 @@ const Wysiwyg = Widget.extend({ if ($wrapwrap.length) { $('#wrapwrap')[0].removeEventListener('scroll', this.odooEditor.multiselectionRefresh, { passive: true }); } - $(this.$root).off('mousedown'); + $(this.$root).off('click'); if (this.linkPopover) { this.linkPopover.hide(); } @@ -759,7 +759,7 @@ const Wysiwyg = Widget.extend({ // We add the field's name as id so default_focus will target it if // needed. For that to work, it has to already be editable but note that // the editor is at this point not yet instantiated. - if (typeof this.options.fieldId !== 'undefined') { + if (typeof this.options.fieldId !== 'undefined' && !this.options.inIframe) { this.$editable.attr('id', this.options.fieldId); this.$editable.attr('contenteditable', true); } diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg_iframe.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg_iframe.js index f5247e74ba5..f913b0340ca 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg_iframe.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg_iframe.js @@ -84,8 +84,12 @@ Wysiwyg.include({ */ _loadIframe: function () { var self = this; + const isEditableRoot = this.$editable === this.$root; this.$editable = $('
'); this.$el.removeClass('note-editable oe_structure odoo-editor-editable'); + if (isEditableRoot) { + this.$root = this.$editable; + } this.$iframe = $('