When a SideDialog
is opened and, during its lifecycle, we invoke a method that programmatically closes the current SideDialog
and immediately opens another one, the second SideDialog
fails to render properly. Although it is instantiated in code, it does not appear in the UI and is closed almost instantly.
Suspected Cause:
This appears to be related to the dialog animation lifecycle. Specifically, the closing animation of the first SideDialog
has not yet completed when the second one is triggered to open.
Expected Behavior:
- Queue the second
SideDialog
until the first one has fully closed (including any animations)
Reproduction:
private async Task OpenSecondDialogImmediately()
{
DialogService.CloseSide(); // Closes the currently open SideDialog
// Immediately open a new SideDialog without waiting
await DialogService.OpenSideAsync<DialogSideContent>("Second Dialog",
new Dictionary<string, object>(),
new SideDialogOptions() { Position = DialogPosition.Right });
}
Adding a delay between operations (e.g., await Task.Delay(400);
) resolves the issue.