Nested dialogs do not fully work

If you have nested dialogs (component A opens dialog A1, and dialog A1 opens dialog A2), the code won't continue when returning from DialogService.OpenAsync for dialog A1.

The problem seems to be that DialogService.OpenAsync overwrites the TaskCompletionSource in the protected field tcs:

public Task<dynamic> OpenAsync<T>(string title, Dictionary<string, object> parameters = null, DialogOptions options = null)
        where T : ComponentBase
            this.tcs = new TaskCompletionSource<object>();
            this.OpenDialog<T>(title, parameters, options);
            return this.tcs.Task;

so when two OpenAsync calls are nested, after returning from OpenDialog, only the latest call
continues executing the code properly. The previous one does not continue.

Probably chaning the tcs to be a stack or a list will fix the problem

It will be fixed in the upcoming update of Radzen.Blazor.

1 Like

Thank you Vladimir. It works great now!