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 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); } } diff --git a/test/UnitTest/Components/SelectTreeTest.cs b/test/UnitTest/Components/SelectTreeTest.cs index 2756044732e..60983f06896 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.Contains("active", nodes[1].ClassName); + } + private List> BindItems { get; } = [ new TreeViewItem("Test1")