From 8f62471ef65eb9e5658d162fa92f9ab9360b17d2 Mon Sep 17 00:00:00 2001 From: Younn Olivier Date: Tue, 22 Jun 2021 12:57:05 +0000 Subject: [PATCH] [FIX] web_editor: close text color palettes when opening option ones When the color palette for the text was open, opening the background color options was not closing it. The click event was stopped at the snippet option level for all events, where it should only be the case if the click was done inside the colorpicker. Part of https://github.com/odoo/odoo/pull/72539 task-2476601 X-original-commit: 888f1bd44d0aa431d3d89ee3c913c6eb64c3d54d --- addons/web_editor/static/src/js/editor/snippets.options.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/web_editor/static/src/js/editor/snippets.options.js b/addons/web_editor/static/src/js/editor/snippets.options.js index 609b259dc46..964ccbf24fa 100644 --- a/addons/web_editor/static/src/js/editor/snippets.options.js +++ b/addons/web_editor/static/src/js/editor/snippets.options.js @@ -1494,10 +1494,11 @@ const ColorpickerUserValueWidget = SelectUserValueWidget.extend({ */ _onClick: function (ev) { // Do not close the colorpalette on colorpicker click - if (!ev.originalEvent.__isColorpickerClick) { - this._super(...arguments); + if (ev.originalEvent.__isColorpickerClick) { + ev.stopPropagation(); + return; } - ev.stopPropagation(); + return this._super(...arguments); }, });