Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>10.7.2</Version>
<Version>10.7.3-beta01</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,11 @@ public async Task TriggerClear()
[JSInvokable]
public async Task TriggerFilter(string val)
{
if (SkipMatch)
{
return;
}

if (OnCustomFilter != null)
{
var items = await OnCustomFilter(val);
Expand Down
17 changes: 17 additions & 0 deletions test/UnitTest/Components/AutoCompleteTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,23 @@ public void SkipMatch_Ok()
Assert.Equal(4, items.Count);
}

[Fact]
public async Task SkipMatch_AfterSelect_Ok()
{
var cut = Context.Render<AutoComplete>(pb =>
{
pb.Add(a => a.SkipMatch, true);
pb.Add(a => a.Items, new List<string>() { "test1", "test12", "test123", "test1234" });
});

// 选中候选项 test123 后 TriggerFilter 不应过滤候选项
// 否则再次输入时 SkipMatch 失效 候选项被锁定为上次选中值的过滤子集
await cut.InvokeAsync(() => cut.FindAll(".dropdown-item")[2].Click());

var items = cut.FindAll(".dropdown-item");
Assert.Equal(4, items.Count);
}

[Fact]
public void Items_Ok()
{
Expand Down
Loading