From 328482e426ea786bff8280204b7b60e19f47481e Mon Sep 17 00:00:00 2001 From: Vincent Baaij Date: Thu, 5 Jun 2025 16:21:35 +0200 Subject: [PATCH 1/3] Fix #3876 by calling HandleOnTabChangedAsync in OnAfterRenderAsync --- examples/Demo/Shared/Pages/Tabs/Examples/TabsDefault.razor | 2 +- src/Core/Components/Tabs/FluentTabs.razor.cs | 5 +++++ src/Core/Microsoft.FluentUI.AspNetCore.Components.csproj | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/Demo/Shared/Pages/Tabs/Examples/TabsDefault.razor b/examples/Demo/Shared/Pages/Tabs/Examples/TabsDefault.razor index 0dcd6d93cb..455c6597e2 100644 --- a/examples/Demo/Shared/Pages/Tabs/Examples/TabsDefault.razor +++ b/examples/Demo/Shared/Pages/Tabs/Examples/TabsDefault.razor @@ -51,7 +51,7 @@ If checked, the contents of Tab two and three will be loaded after 1 second of p @code { bool DeferredLoading = false; - string? activeid = "tab-1"; + string? activeid = "tab-3"; FluentTab? changedto; private void HandleOnTabChange(FluentTab tab) diff --git a/src/Core/Components/Tabs/FluentTabs.razor.cs b/src/Core/Components/Tabs/FluentTabs.razor.cs index 3dc2df38ff..752dfb42cf 100644 --- a/src/Core/Components/Tabs/FluentTabs.razor.cs +++ b/src/Core/Components/Tabs/FluentTabs.razor.cs @@ -156,6 +156,11 @@ protected override async Task OnAfterRenderAsync(bool firstRender) var horizontal = Orientation == Orientation.Horizontal; await _jsModuleOverflow.InvokeVoidAsync("fluentOverflowInitialize", _dotNetHelper, Id, horizontal, FLUENT_TAB_TAG, 25); + + if (ActiveTabId is not null) + { + await HandleOnTabChangedAsync(new TabChangeEventArgs() { ActiveId = ActiveTabId }); + } } } diff --git a/src/Core/Microsoft.FluentUI.AspNetCore.Components.csproj b/src/Core/Microsoft.FluentUI.AspNetCore.Components.csproj index 02d223b148..eb345a53e9 100644 --- a/src/Core/Microsoft.FluentUI.AspNetCore.Components.csproj +++ b/src/Core/Microsoft.FluentUI.AspNetCore.Components.csproj @@ -1,6 +1,6 @@ - net8.0;net9.0;net10.0 + net8.0;net9.0 Microsoft.FluentUI.AspNetCore.Components A Blazor component library leveraging Microsoft’s Fluent Design System UI. Use the look of modern Microsoft products in your Blazor applications From fd9fc5c5009d38e9344eb859aefc3d9660d01d19 Mon Sep 17 00:00:00 2001 From: Vincent Baaij Date: Thu, 5 Jun 2025 17:14:10 +0200 Subject: [PATCH 2/3] =?UTF-8?q?re-add=20.NET=2010=20TFM=20(again=20?= =?UTF-8?q?=F0=9F=A4=A6=E2=80=8D=E2=99=80=EF=B8=8F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Core/Microsoft.FluentUI.AspNetCore.Components.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Core/Microsoft.FluentUI.AspNetCore.Components.csproj b/src/Core/Microsoft.FluentUI.AspNetCore.Components.csproj index eb345a53e9..799c1a01dd 100644 --- a/src/Core/Microsoft.FluentUI.AspNetCore.Components.csproj +++ b/src/Core/Microsoft.FluentUI.AspNetCore.Components.csproj @@ -1,6 +1,6 @@ - net8.0;net9.0 + net8.0;net9.0;net10.0> Microsoft.FluentUI.AspNetCore.Components A Blazor component library leveraging Microsoft’s Fluent Design System UI. Use the look of modern Microsoft products in your Blazor applications From c0222e5718f8d41b29dca6b683d6adecb6bc4a53 Mon Sep 17 00:00:00 2001 From: Vincent Baaij Date: Thu, 5 Jun 2025 18:15:28 +0200 Subject: [PATCH 3/3] Update Microsoft.FluentUI.AspNetCore.Components.csproj --- src/Core/Microsoft.FluentUI.AspNetCore.Components.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Core/Microsoft.FluentUI.AspNetCore.Components.csproj b/src/Core/Microsoft.FluentUI.AspNetCore.Components.csproj index 799c1a01dd..02d223b148 100644 --- a/src/Core/Microsoft.FluentUI.AspNetCore.Components.csproj +++ b/src/Core/Microsoft.FluentUI.AspNetCore.Components.csproj @@ -1,6 +1,6 @@ - net8.0;net9.0;net10.0> + net8.0;net9.0;net10.0 Microsoft.FluentUI.AspNetCore.Components A Blazor component library leveraging Microsoft’s Fluent Design System UI. Use the look of modern Microsoft products in your Blazor applications