Skip to content

Commit

Permalink
feat(TreeView): use Task instead of ValueTask (#4737)
Browse files Browse the repository at this point in the history
* refactor(TreeView): use Task instead of ValueTask

* chore: bump version 9.0.2-beta03
  • Loading branch information
ArgoZhang authored Nov 25, 2024
1 parent 233ea83 commit 8308fb4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 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.0.2-beta02</Version>
<Version>9.0.2-beta03</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/BootstrapBlazor/Components/TreeView/TreeView.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ public async ValueTask TriggerKeyDown(string key)
/// <param name="items"></param>
/// <returns></returns>
[JSInvokable]
public ValueTask<List<CheckboxState>> GetParentsState(List<int> items)
public Task<List<CheckboxState>> GetParentsState(List<int> items)
{
var rows = Rows;
var result = items.Select(i =>
Expand All @@ -447,7 +447,7 @@ public ValueTask<List<CheckboxState>> GetParentsState(List<int> items)
item.CheckedState = checkedState;
return checkedState;
}).ToList();
return ValueTask.FromResult(result);
return Task.FromResult(result);
}

private static bool IsExpand(TreeViewItem<TItem> item) => item.IsExpand && item.Items.Count > 0;
Expand Down

0 comments on commit 8308fb4

Please sign in to comment.