Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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>9.2.1-beta01</Version>
<Version>9.2.1-beta02</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/BootstrapBlazor/Components/Select/SelectTree.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ private async Task TriggerItemChanged(Func<TreeViewItem<TValue>, bool> predicate
var currentItem = GetExpandedItems().FirstOrDefault(predicate);
if (currentItem != null)
{
currentItem.IsActive = true;
await ItemChanged(currentItem);
}
}
Expand Down
14 changes: 14 additions & 0 deletions test/UnitTest/Components/SelectTreeTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<SelectTree<TreeFoo>>(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<TreeViewItem<string>> BindItems { get; } =
[
new TreeViewItem<string>("Test1")
Expand Down
Loading