File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
src/BootstrapBlazor/Components/SweetAlert Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,11 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
9393 }
9494 await Task . Delay ( Delay , DelayToken . Token ) ;
9595 await ModalContainer . Close ( ) ;
96+
97+ if ( OnCloseCallbackAsync != null )
98+ {
99+ await OnCloseCallbackAsync ( ) ;
100+ }
96101 }
97102 catch ( TaskCanceledException ) { }
98103 }
@@ -101,6 +106,8 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
101106
102107 private bool AutoHideCheck ( ) => IsAutoHide && Delay > 0 ;
103108
109+ private Func < Task > ? OnCloseCallbackAsync = null ;
110+
104111 private async Task Show ( SwalOption option )
105112 {
106113 if ( ! IsShowDialog )
@@ -122,6 +129,8 @@ private async Task Show(SwalOption option)
122129
123130 DialogParameter = parameters ;
124131
132+ OnCloseCallbackAsync = AutoHideCheck ( ) ? option . OnCloseAsync : null ;
133+
125134 // 渲染 UI 准备弹窗 Dialog
126135 await InvokeAsync ( StateHasChanged ) ;
127136 }
You can’t perform that action at this time.
0 commit comments