diff --git a/addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js b/addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js index 370009b1a93..3283e62f21c 100644 --- a/addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js +++ b/addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js @@ -374,10 +374,20 @@ export class WysiwygAdapterComponent extends ComponentAdapter { // grep: COMPANY_TEAM_CONTENTEDITABLE const $extraEditableZones = $editableSavableZones.find('.s_company_team .o_not_editable img'); - return $editableSavableZones.add($extraEditableZones).toArray(); + return $editableSavableZones.add($extraEditableZones).toArray().concat( + // To make sure the selection remains bounded to the active tab, + // each tab is made non editable while keeping its nested + // oe_structure editable. This avoids having a selection range span + // over all further inactive tabs when using Chrome. + ...this.websiteService.pageDocument.querySelectorAll('#wrapwrap .s_tabs > div > .s_tabs_main > .s_tabs_content > .tab-pane > .oe_structure') + ); } _getReadOnlyAreas() { - return []; + // To make sure the selection remains bounded to the active tab, + // each tab is made non editable while keeping its nested + // oe_structure editable. This avoids having a selection range span + // over all further inactive tabs when using Chrome. + return this.websiteService.pageDocument.querySelectorAll('#wrapwrap .s_tabs > div > .s_tabs_main > .s_tabs_content > .tab-pane'); } _getUnremovableElements() { return []; diff --git a/addons/website_sale/static/src/js/components/wysiwyg_adapter/wysiwyg_adapter.js b/addons/website_sale/static/src/js/components/wysiwyg_adapter/wysiwyg_adapter.js index d372dbe957d..6d682df3594 100644 --- a/addons/website_sale/static/src/js/components/wysiwyg_adapter/wysiwyg_adapter.js +++ b/addons/website_sale/static/src/js/components/wysiwyg_adapter/wysiwyg_adapter.js @@ -24,6 +24,9 @@ patch(WysiwygAdapterComponent.prototype, 'website_sale_wysiwyg_adapter', { * @override */ _getReadOnlyAreas() { - return $(this.websiteService.pageDocument).find("#wrapwrap").find('.oe_website_sale .products_header, .oe_website_sale .products_header a').toArray(); + const readOnlyEls = this._super(...arguments); + return [...readOnlyEls].concat( + $(this.websiteService.pageDocument).find("#wrapwrap").find('.oe_website_sale .products_header, .oe_website_sale .products_header a').toArray() + ); }, });