From 0d4a21bae5af14f67dc2820fb41ae87a405b695e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Geelen=20=28sge=29?= Date: Mon, 12 Jul 2021 09:39:41 +0000 Subject: [PATCH] [FIX] web_editor: ensure colors are kept properly Color and background-color styles on `` tags were being wrongly overridden when applying another color or background color to the element. Task-2580158 (cherry picked from commit a532d096faf55550ac6d01795aaa2b6843ebc988) --- .../web_editor/static/lib/odoo-editor/src/commands/commands.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_editor/static/lib/odoo-editor/src/commands/commands.js b/addons/web_editor/static/lib/odoo-editor/src/commands/commands.js index 22a970ec789..3efb47ad2e9 100644 --- a/addons/web_editor/static/lib/odoo-editor/src/commands/commands.js +++ b/addons/web_editor/static/lib/odoo-editor/src/commands/commands.js @@ -498,7 +498,7 @@ export const editorCommands = { // Color the selected s and remove uncolored fonts. for (const font of new Set(fonts)) { colorElement(font, color, mode); - if (!hasColor(font, mode) && !hasColor(font, mode)) { + if (!hasColor(font, mode) && !font.hasAttribute('style')) { for (const child of [...font.childNodes]) { font.parentNode.insertBefore(child, font); }