Skip to content

Commit 558a206

Browse files
authored
🐛 fix(SimpleConfirm): close confirm correctly after clicking 'ESC' key (#800)
1 parent 083e9c5 commit 558a206

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/Masa.Stack.Components/Shared/IntegrationComponents/Confirm/SSimpleConfirm.razor

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@inherits Masa.Blazor.Popup.Components.AlertingPopupComponentBase
22

33
<MDialog @bind-Value="@Visible"
4+
@bind-Value:after="OnVisibleChanged"
45
Class="pa-6"
56
ContentClass="pa-6 white rounded-5"
67
Width="400">
@@ -69,9 +70,16 @@
6970
[Parameter]
7071
public EventCallback OnOk { get; set; }
7172

72-
private I18n? _languageProvider;
7373
private string ComputedCancelText => CancelText ?? T("Cancel");
7474
private string ComputedOkText => OkText ?? T("Ok");
75+
76+
private async Task OnVisibleChanged()
77+
{
78+
if (!Visible)
79+
{
80+
await SetResult(false);
81+
}
82+
}
7583

7684
public virtual async Task HandleOnCancel()
7785
{

0 commit comments

Comments
 (0)