Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions src/BootstrapBlazor/Components/Button/Button.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,7 @@ protected virtual async Task OnClickButton()
IsDisabled = true;
}

if (IsAsync)
{
await Task.Run(() => InvokeAsync(HandlerClick));
}
else
{
await HandlerClick();
}
await HandlerClick();

// 恢复按钮
if (IsAsync && ButtonType == ButtonType.Button)
Expand Down
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/Components/Button/CountButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected override async Task OnClickButton()
IsAsyncLoading = true;
IsDisabled = true;

await Task.Run(() => InvokeAsync(HandlerClick));
await HandlerClick();
await UpdateCount();

IsDisabled = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,7 @@
IsDisabled = true;
IsAsyncLoading = true;
StateHasChanged();

if (OnConfirm != null)
{
await Task.Run(() => InvokeAsync(OnConfirm));
}
await OnConfirm();

Check warning on line 102 in src/BootstrapBlazor/Components/Button/PopConfirmButton.razor.cs

View workflow job for this annotation

GitHub Actions / run test

Dereference of a possibly null reference.

if (ButtonType == ButtonType.Submit)
{
Expand Down