Hi,
I am trying to write some code to handle showing a busy dialog while a page is loading over the page. I have simplified my issue below to the demo the problem.
protected override async Task OnInitializedAsync()
{
DialogService.OnOpen += Open;
DialogService.OnClose += Close;
DialogService.Open("", ds =>
@<div>
<div class="row">
<div class="col-md-12">
Please wait...
</div>
</div>
</div>, new DialogOptions() { ShowTitle = false, Style = "min-height:auto;min-width:auto;width:auto" });
await CallWeather();
DialogService.Close();
}
I have tried using async and none async open, and in the OnAfterRender and on initialised. Regardless how i do this when i navigate to this page the dialog does not appear. in the logs it appears the dialog does open but instantly closes itself. I have placed console logs to ensure the close isn't called instantly and it is not so something else is closing it.
The odd part is most approaches i try, if i hit F5 on the page itself it works as expected. But once i navigate away and back to the page it does not show the dialog again.
This seems to be something triggering the dialog to close outside my control but i can't see what or how to get around it.