diff --git a/src/Core/Components/Tabs/FluentTabs.razor.cs b/src/Core/Components/Tabs/FluentTabs.razor.cs index fe6e38fe5c..a67ca8cfa3 100644 --- a/src/Core/Components/Tabs/FluentTabs.razor.cs +++ b/src/Core/Components/Tabs/FluentTabs.razor.cs @@ -14,6 +14,8 @@ public partial class FluentTabs : FluentComponentBase private DotNetObjectReference? _dotNetHelper = null; private IJSObjectReference _jsModuleOverflow = default!; + private bool _shouldRender = true; + /// protected string? ClassValue => new CssBuilder(Class) .Build(); @@ -153,6 +155,11 @@ protected override async Task OnAfterRenderAsync(bool firstRender) } } + protected override bool ShouldRender() + { + return _shouldRender; + } + private async Task HandleOnTabChanged(TabChangeEventArgs args) { if (args is not null) @@ -164,6 +171,11 @@ private async Task HandleOnTabChanged(TabChangeEventArgs args) ActiveTabId = tabId; await ActiveTabIdChanged.InvokeAsync(tabId); } + _shouldRender = true; + } + else + { + _shouldRender = false; } }