From 8c759de6da974dc530afd1dff2720c1d6f028a08 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Tue, 31 Dec 2024 12:52:23 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20Value=20?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=20IsActive=20=E7=8A=B6=E6=80=81=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor/Components/Select/SelectTree.razor.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/BootstrapBlazor/Components/Select/SelectTree.razor.cs b/src/BootstrapBlazor/Components/Select/SelectTree.razor.cs index 3a129f0b832..efe1266f51f 100644 --- a/src/BootstrapBlazor/Components/Select/SelectTree.razor.cs +++ b/src/BootstrapBlazor/Components/Select/SelectTree.razor.cs @@ -232,6 +232,7 @@ private async Task TriggerItemChanged(Func, bool> predicate var currentItem = GetExpandedItems().FirstOrDefault(predicate); if (currentItem != null) { + currentItem.IsActive = true; await ItemChanged(currentItem); } } From f2fcd0d0a55a0deeb22082b019e2a717c819400f Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Tue, 31 Dec 2024 12:53:22 +0800 Subject: [PATCH 2/4] chore: bump version 9.2.1-beta02 Co-Authored-By: AiZhen <53560110+AiYuZhen@users.noreply.github.com> --- src/BootstrapBlazor/BootstrapBlazor.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BootstrapBlazor/BootstrapBlazor.csproj b/src/BootstrapBlazor/BootstrapBlazor.csproj index 4fbb53d2166..e73e8b62633 100644 --- a/src/BootstrapBlazor/BootstrapBlazor.csproj +++ b/src/BootstrapBlazor/BootstrapBlazor.csproj @@ -1,7 +1,7 @@ - 9.2.1-beta01 + 9.2.1-beta02 From adaad7c9b4db6c8041f61c8dde5f75d7d582c190 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Tue, 31 Dec 2024 13:04:16 +0800 Subject: [PATCH 3/4] =?UTF-8?q?test:=20=E5=A2=9E=E5=8A=A0=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/UnitTest/Components/SelectTreeTest.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/UnitTest/Components/SelectTreeTest.cs b/test/UnitTest/Components/SelectTreeTest.cs index 2756044732e..0970f398eea 100644 --- a/test/UnitTest/Components/SelectTreeTest.cs +++ b/test/UnitTest/Components/SelectTreeTest.cs @@ -190,6 +190,20 @@ public void IsPopover_Ok() cut.DoesNotContain("data-bs-toggle=\"dropdown\""); } + [Fact] + public void IsActive_Ok() + { + var items = TreeFoo.GetTreeItems(); + var cut = Context.RenderComponent>(builder => + { + builder.Add(p => p.Items, items); + builder.Add(p => p.Value, new TreeFoo() { Id = "1020", Text = "Navigation Two" }); + }); + var nodes = cut.FindAll(".tree-content"); + Assert.Equal(3, nodes.Count); + Assert.True(nodes[1].ClassName == "tree-content active"); + } + private List> BindItems { get; } = [ new TreeViewItem("Test1") From 77a2114e87b2dc19e3859d9c05aa58f9de950257 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Tue, 31 Dec 2024 13:08:33 +0800 Subject: [PATCH 4/4] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=94=B9=E5=88=A4?= =?UTF-8?q?=E5=AE=9A=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/UnitTest/Components/SelectTreeTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/UnitTest/Components/SelectTreeTest.cs b/test/UnitTest/Components/SelectTreeTest.cs index 0970f398eea..60983f06896 100644 --- a/test/UnitTest/Components/SelectTreeTest.cs +++ b/test/UnitTest/Components/SelectTreeTest.cs @@ -201,7 +201,7 @@ public void IsActive_Ok() }); var nodes = cut.FindAll(".tree-content"); Assert.Equal(3, nodes.Count); - Assert.True(nodes[1].ClassName == "tree-content active"); + Assert.Contains("active", nodes[1].ClassName); } private List> BindItems { get; } =