Blazorise icon indicating copy to clipboard operation
Blazorise copied to clipboard

[Bug]: TreeView ExpandedNodes binding not working after first-render

Open njannink opened this issue 4 months ago • 0 comments

Blazorise Version

1.7

What Blazorise provider are you running on?

Material

Link to minimal reproduction or a simple code snippet

<TreeView Nodes="@Root.Items"
                  GetChildNodes="@(x => x is FolderViewModel f ? f.Items : [])"
                  HasChildNodes="@(x => x is FolderViewModel f && f.Items.Count > 0)"
                  @bind-ExpandedNodes="_expandedNodes"
                  @bind-SelectedNode="@SelectedNode">
    <NodeContent>@context.Name</NodeContent>
</TreeView>

Steps to reproduce & bug description

Add another item to _expandedNodes list and call StateHasChanged()

What is expected?

That the additional folders added to the list are expanded aswell

What is actually happening?

Nothing seems to be that the binding only works at first-render after that its one way from the tree and it doesnt respond to added nodes

What browsers do you see the problem on?

Microsoft Edge

Any additional comments?

No response

njannink avatar Jun 17 '25 16:06 njannink