diff --git a/addons/web_editor/static/src/js/wysiwyg/widgets/color_palette.js b/addons/web_editor/static/src/js/wysiwyg/widgets/color_palette.js index 955faa039a9..54dc8232bb5 100644 --- a/addons/web_editor/static/src/js/wysiwyg/widgets/color_palette.js +++ b/addons/web_editor/static/src/js/wysiwyg/widgets/color_palette.js @@ -38,6 +38,7 @@ const ColorPaletteWidget = Widget.extend({ */ init: function (parent, options) { this._super.apply(this, arguments); + this.customColorsArray = [].concat(...customColors); this.style = window.getComputedStyle(document.documentElement); this.options = _.extend({ selectedColor: false, @@ -173,7 +174,7 @@ const ColorPaletteWidget = Widget.extend({ return; } this.el.querySelectorAll('.o_custom_color').forEach(el => el.remove()); - const existingColors = new Set(customColors.concat( + const existingColors = new Set(this.customColorsArray.concat( Object.keys(this.colorToColorNames) )); this.trigger_up('get_custom_colors', {