From cf19b6a3e8263ea0b6e3513ca4c72509da933463 Mon Sep 17 00:00:00 2001 From: enisn Date: Fri, 24 Nov 2023 11:47:19 +0300 Subject: [PATCH] Better PageHeader rendering for Settings --- .../SettingManagement/SettingManagement.razor.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/SettingManagement.razor.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/SettingManagement.razor.cs index f4c66e2374..202598ff8d 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/SettingManagement.razor.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/SettingManagement.razor.cs @@ -45,10 +45,15 @@ public partial class SettingManagement SelectedGroup = GetNormalizedString(SettingComponentCreationContext.Groups.First().Id); } - protected override Task OnAfterRenderAsync(bool firstRender) + protected override async Task OnAfterRenderAsync(bool firstRender) { - StateHasChanged(); - return base.OnAfterRenderAsync(firstRender); + if (firstRender) + { + await Task.Yield(); + await InvokeAsync(StateHasChanged); + } + + await base.OnAfterRenderAsync(firstRender); } protected virtual string GetNormalizedString(string value)