Skip to content

Commit

Permalink
fix(AutoComplete): do not show Items when set OnCustomFilter (#5053)
Browse files Browse the repository at this point in the history
* fix: 无法显示数据问题

* chore: bump version 9.2.5
  • Loading branch information
ArgoZhang authored Jan 6, 2025
1 parent bb08bc6 commit 2fa34aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/BootstrapBlazor.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<Version>9.2.5-beta02</Version>
<Version>9.2.5</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ protected override void OnParametersSet()
PlaceHolder ??= Localizer[nameof(PlaceHolder)];
Icon ??= IconTheme.GetIconByKey(ComponentIcons.AutoCompleteIcon);

FilterItems = Items?.ToList() ?? [];
FilterItems ??= Items?.ToList() ?? [];
}

/// <summary>
Expand Down Expand Up @@ -145,9 +145,11 @@ public async Task TriggerOnChange(string val)
else
{
var comparison = IgnoreCase ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
var items = IsLikeMatch
? Items.Where(s => s.Contains(val, comparison))
: Items.Where(s => s.StartsWith(val, comparison));
var items = string.IsNullOrEmpty(val)
? Items
: IsLikeMatch
? Items.Where(s => s.Contains(val, comparison))
: Items.Where(s => s.StartsWith(val, comparison));
FilterItems = items.ToList();
}

Expand Down

0 comments on commit 2fa34aa

Please sign in to comment.