Skip to content

Commit

Permalink
[TreeItem] Only pass initially selected state to the web component (#…
Browse files Browse the repository at this point in the history
…2916)

* Fix #2911 by only passing initially selected state to the fluent-tree-item WC

* Make GetFluewtnTreeItem use InitiallySelected

* Update IssueTester.razor

---------

Co-authored-by: Denis Voituron <[email protected]>
  • Loading branch information
vnbaaij and dvoituron authored Nov 10, 2024
1 parent b56bcd3 commit 9052461
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/Demo/Shared/Pages/Lab/IssueTester.razor
Original file line number Diff line number Diff line change
@@ -1 +1 @@


2 changes: 1 addition & 1 deletion src/Core/Components/TreeView/FluentTreeItem.razor
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
style="@Style"
id="@Id"
expanded="@Expanded"
selected="@Selected"
selected="@InitiallySelected"
disabled="@Disabled"
@onselectedchange="@HandleSelectedChangeAsync"
@onexpandedchange="@HandleExpandedChangeAsync"
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Components/TreeView/FluentTreeItem.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ internal static RenderFragment GetFluentTreeItem(FluentTreeView owner, ITreeView
builder.AddAttribute(i++, "Id", item.Id);
builder.AddAttribute(i++, "Items", item.Items);
builder.AddAttribute(i++, "Text", item.Text);
builder.AddAttribute(i++, "Selected", owner.SelectedItem == item);
builder.AddAttribute(i++, "InitiallySelected", owner.SelectedItem == item);
builder.AddAttribute(i++, "Expanded", item.Expanded);
builder.AddAttribute(i++, "Disabled", item.Disabled);
builder.AddAttribute(i++, "IconCollapsed", item.IconCollapsed);
Expand Down

0 comments on commit 9052461

Please sign in to comment.