diff --git a/addons/web_editor/static/src/js/editor/odoo-editor/src/commands/toggleList.js b/addons/web_editor/static/src/js/editor/odoo-editor/src/commands/toggleList.js index 63cbbea2752..a82ed5b9607 100644 --- a/addons/web_editor/static/src/js/editor/odoo-editor/src/commands/toggleList.js +++ b/addons/web_editor/static/src/js/editor/odoo-editor/src/commands/toggleList.js @@ -40,9 +40,13 @@ HTMLElement.prototype.oToggleList = function (offset, mode = 'UL') { HTMLParagraphElement.prototype.oToggleList = function (offset, mode = 'UL') { const restoreCursor = preserveCursor(this.ownerDocument); const list = insertListAfter(this, mode, [[...this.childNodes]]); + const classList = [...list.classList]; for (const attribute of this.attributes) { list.setAttribute(attribute.name, attribute.value); } + for (const className of classList) { + list.classList.toggle(className, true); // restore list classes + } this.remove(); restoreCursor(new Map([[this, list.firstChild]]));