From e774b33222b5ebe8c3dc3989e4daa82a79c41357 Mon Sep 17 00:00:00 2001 From: zsmj Date: Wed, 7 Sep 2022 15:01:11 +0800 Subject: [PATCH] =?UTF-8?q?BI-113533=20fix:=20bi.color=5Fchooser=20destroy?= =?UTF-8?q?WhenHide=20=E5=9C=BA=E6=99=AF=E4=B8=8B=E4=BA=8C=E6=AC=A1?= =?UTF-8?q?=E5=88=9B=E5=BB=BApopup=E7=8A=B6=E6=80=81=E7=9A=84=E4=BF=9D?= =?UTF-8?q?=E6=8C=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/colorchooser/colorchooser.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/case/colorchooser/colorchooser.js b/src/case/colorchooser/colorchooser.js index 991be4a77..df4d9eb1b 100644 --- a/src/case/colorchooser/colorchooser.js +++ b/src/case/colorchooser/colorchooser.js @@ -39,7 +39,7 @@ BI.ColorChooser = BI.inherit(BI.Widget, { width: o.el.type ? o.width : o.width - 2, height: o.el.type ? o.height : o.height - 2 }, o.el), - popup: { + popup: () => ({ el: BI.extend({ type: "bi.hex_color_chooser_popup", recommendColorsGetter: o.recommendColorsGetter, @@ -64,13 +64,13 @@ BI.ColorChooser = BI.inherit(BI.Widget, { }, o.popup), value: o.value, width: 300 - }, + }), value: o.value }); var fn = function () { var color = self.colorPicker.getValue(); - self.trigger.setValue(color); + self.setValue(color); }; this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW, function () { @@ -98,7 +98,8 @@ BI.ColorChooser = BI.inherit(BI.Widget, { }, setValue: function (color) { - this.combo.setValue((color || "").toLowerCase()); + this.options.value = (color || "").toLowerCase(); + this.combo.setValue(this.options.value); }, getValue: function () {