Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</FluentAccordionItem>
</FluentAccordion>

<p>Last changed accordion item: @(changed?.Heading ?? "item with HeaderTemplate")</p>
<p>Last changed accordion item: @(changed?.Heading ?? "item with HeaderTemplate"), Expanded: @changed?.Expanded</p>


@code {
Expand All @@ -35,4 +35,4 @@
{
changed = item;
}
}
}
5 changes: 5 additions & 0 deletions src/Core/Components/Accordion/FluentAccordion.razor.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// ------------------------------------------------------------------------
// MIT License - Copyright (c) Microsoft Corporation. All rights reserved.
// ------------------------------------------------------------------------

using System.Diagnostics.CodeAnalysis;
using Microsoft.AspNetCore.Components;

Expand Down Expand Up @@ -52,6 +56,7 @@ private async Task HandleOnAccordionChangedAsync(AccordionChangeEventArgs args)
var Id = args.ActiveId;
if (Id is not null && items.TryGetValue(Id!, out FluentAccordionItem? item))
{
item.Expanded = args.Expanded;
await OnAccordionItemChange.InvokeAsync(item);
await ActiveIdChanged.InvokeAsync(Id);
}
Expand Down
Loading