From 38d0aff76d29b92e54de163710bc9e0cce698b20 Mon Sep 17 00:00:00 2001 From: Vincent Baaij Date: Thu, 28 Dec 2023 08:57:48 +0100 Subject: [PATCH] Fix #1194 #v3 (#1222) * Fix #1194 #v3 * Add _shouldRender =true to if to be on the safe side --- src/Core/Components/Tabs/FluentTabs.razor.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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; } }