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; };