From 68ca63c820f7a8907e6785be4d0ea75f345460f6 Mon Sep 17 00:00:00 2001 From: Argo-Tianyi Date: Wed, 10 Nov 2021 05:07:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20Tooltip=20=E5=9F=BA?= =?UTF-8?q?=E7=B1=BB=E6=8A=A5=E8=AD=A6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/BaseComponents/TooltipComponentBase.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/BootstrapBlazor/Components/BaseComponents/TooltipComponentBase.cs b/src/BootstrapBlazor/Components/BaseComponents/TooltipComponentBase.cs index 06572bf27..b00f06874 100644 --- a/src/BootstrapBlazor/Components/BaseComponents/TooltipComponentBase.cs +++ b/src/BootstrapBlazor/Components/BaseComponents/TooltipComponentBase.cs @@ -17,6 +17,8 @@ namespace BootstrapBlazor.Components /// public ITooltip? Tooltip { get; set; } + private bool IsInited { get; set; } + /// /// OnAfterRenderAsync /// @@ -36,6 +38,7 @@ namespace BootstrapBlazor.Components { await ShowPopover(); } + IsInited = true; } } @@ -115,7 +118,7 @@ namespace BootstrapBlazor.Components /// protected virtual async ValueTask DisposeAsyncCore(bool disposing) { - if (disposing && Tooltip != null) + if (disposing && Tooltip != null && IsInited) { var id = RetrieveId(); if (!string.IsNullOrEmpty(id)) -- Gitee