File tree Expand file tree Collapse file tree
src/BootstrapBlazor/Components/Button Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33// See the LICENSE file in the project root for more information.
44// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
55
6- using Microsoft . AspNetCore . Components . Web ;
7-
86namespace BootstrapBlazor . Components ;
97
108/// <summary>
@@ -65,7 +63,7 @@ public abstract class ButtonBase : TooltipWrapperBase
6563 /// <para lang="en">Gets or sets the OnClick event</para>
6664 /// </summary>
6765 [ Parameter ]
68- public EventCallback < MouseEventArgs > OnClick { get ; set ; }
66+ public EventCallback OnClick { get ; set ; }
6967
7068 /// <summary>
7169 /// <para lang="zh">获得/设置 OnClick 事件不刷新父组件</para>
@@ -334,6 +332,16 @@ protected override async ValueTask DisposeAsync(bool disposing)
334332 {
335333 if ( disposing )
336334 {
335+ if ( OnClick . HasDelegate )
336+ {
337+ OnClick = EventCallback . Empty ;
338+ }
339+
340+ if ( IsAsync && ValidateForm != null )
341+ {
342+ ValidateForm . UnregisterAsyncSubmitButton ( this ) ;
343+ }
344+
337345 await RemoveTooltip ( ) ;
338346 }
339347 await base . DisposeAsync ( disposing ) ;
You can’t perform that action at this time.
0 commit comments