I have Blazor WebAssembly app with a List and an Edit page.
When I view a list of entities, and click on one to edit, using a NavLink component, browser navigates to the Edit page, displaying my Loader component, until the page is loaded.
That works nicely.
When I click Save on my Edit page, if successful, I navigate back to my List page.
private async Task OnValidSubmitAsync()
{
this.IsBusy = true;
var @event =
await this.EventService.UpdateByIdAsync(
this.Id,
this.EventUpdateOptions);
this.IsBusy = false;
this.NavigationManager.NavigateTo($"/teams/{this.Event.Team.Id}/events");
}
What I would expect to happen is it would navigate to the List page, displaying my Loader component again and then render the List page.
What happens though, is it stays on the Edit page until the List page is rendered, I never see my Loader component, and it to the user, looks like it is just hanging on the Edit page.
Workaround would be to display my Loader in the OnValidateSubmitAsync, after I am done saving the entity.
I am new to Blazor, still getting the page life cycle down, so it is possible my approach is incorrect. Just a bit confused on what is going on here, and if there is a way to force the List page to show with the Loader.
Hopefully that made some sense.