Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix taskCompletionSourceVariable that gets 'nulled' when a task is co… #24

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
1 change: 0 additions & 1 deletion BlazorDialog/Components/Dialog.razor
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@
if (taskCompletionSource != null)
{
taskCompletionSource.SetResult(result);
taskCompletionSource = null;
}
};
}
Expand Down
17 changes: 14 additions & 3 deletions TestApps/BlazorDialog.TestAppsCommon/IndexCommon.razor
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,15 @@
<button @onclick="SimpleDialogOnClick">Simple Dialog</button>
<button @onclick="SimpleDialogBigOnClick">Simple Dialog Big</button>
<button @onclick="SimpleLargeDialogDisablePreventNavigation">Simple Dialog Big allow navigation</button>

<button @onclick="SimpleDialogBackToBack">Simple Dialog BackToBack</button>
@if (dialogResult != null)
{
<div>DialogResult: @dialogResult</div>
<div>DialogResult: @dialogResult @((secondDialogResult != null) ? "and " + secondDialogResult : "") </div>
}

@code{
@code {
string dialogResult = null;
string secondDialogResult = null;
bool isCentered;
DialogSize size;
DialogAnimation animation;
Expand All @@ -147,6 +148,16 @@
dialogResult = await dialogService.ShowDialog<string>("simple-dialog", "(Simple Dialog) Are you sure?");
}

async Task SimpleDialogBackToBack()
{
dialogResult = await dialogService.ShowDialog<string>("simple-dialog", "(Simple Dialog) Are you sure?");
if (dialogResult == "no")
{
return;
}
secondDialogResult = await dialogService.ShowDialog<string>("simple-dialog", "(Simple Dialog) Are you really sure?");
}

async Task SimpleDialogBigOnClick()
{
dialogResult = await dialogService.ShowDialog<string>("simple-large-dialog", "(Simple Dialog Large) Are you sure?");
Expand Down