Skip to content

Commit b82e5af

Browse files
authored
[Tabs] Make initialization logic more robust (#3878)
1 parent 7471a46 commit b82e5af

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

examples/Demo/Shared/Pages/Tabs/Examples/TabsDefault.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ If checked, the contents of Tab two and three will be loaded after 1 second of p
5151
@code {
5252
bool DeferredLoading = false;
5353

54-
string? activeid = "tab-1";
54+
string? activeid = "tab-3";
5555
FluentTab? changedto;
5656

5757
private void HandleOnTabChange(FluentTab tab)

src/Core/Components/Tabs/FluentTabs.razor.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
156156

157157
var horizontal = Orientation == Orientation.Horizontal;
158158
await _jsModuleOverflow.InvokeVoidAsync("fluentOverflowInitialize", _dotNetHelper, Id, horizontal, FLUENT_TAB_TAG, 25);
159+
160+
if (ActiveTabId is not null)
161+
{
162+
await HandleOnTabChangedAsync(new TabChangeEventArgs() { ActiveId = ActiveTabId });
163+
}
159164
}
160165
}
161166

0 commit comments

Comments
 (0)