From 66860ba87302566937f4eacd31ae69432e637a5f Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Tue, 20 Aug 2019 12:53:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E6=A1=86=E5=87=BA=E7=8E=B0=E5=A4=9A=E4=B8=AAactive=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bootstrap.Admin/wwwroot/lib/longbow-select/longbow-select.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Bootstrap.Admin/wwwroot/lib/longbow-select/longbow-select.js b/Bootstrap.Admin/wwwroot/lib/longbow-select/longbow-select.js index 3ca77918..6001c350 100644 --- a/Bootstrap.Admin/wwwroot/lib/longbow-select/longbow-select.js +++ b/Bootstrap.Admin/wwwroot/lib/longbow-select/longbow-select.js @@ -149,15 +149,17 @@ // see https://gitee.com/LongbowEnterprise/longbow-select/issues/IZ3BR?from=project-issue this.$input.attr('value', '').removeClass('is-valid is-invalid'); this.$menus.html(''); + var $activeItem = null; $.each(value, function (index) { var $item = $('' + this.text + ''); that.$menus.append($item); if (this.selected === true || this.value === oldValue || index === 0 || this.value === that.$element.attr('data-default-val')) { that.$input.attr('value', this.text); that.$element.val(this.value).attr('data-text', this.text); - $item.addClass('active'); + $activeItem = $item; } }); + if ($activeItem !== null) $activeItem.addClass('active'); this.source = value; };