Browse Source
Merge pull request #19334 from abpframework/pageheader
Prevent Toolbar flickering problem
pull/19337/head
Enis Necipoglu
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
16 additions and
0 deletions
-
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor.cs
|
|
|
@ -57,6 +57,12 @@ public partial class PageHeader : ComponentBase |
|
|
|
if (Toolbar != null) |
|
|
|
{ |
|
|
|
var toolbarItems = await PageToolbarManager.GetItemsAsync(Toolbar); |
|
|
|
|
|
|
|
if (!ShouldRenderToolbarItems(toolbarItems)) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
ToolbarItemRenders.Clear(); |
|
|
|
|
|
|
|
if (!Options.Value.RenderToolbar) |
|
|
|
@ -88,6 +94,16 @@ public partial class PageHeader : ComponentBase |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
protected virtual bool ShouldRenderToolbarItems(PageToolbarItem[] items) |
|
|
|
{ |
|
|
|
if (items.Length != PageLayout.ToolbarItems.Count) |
|
|
|
{ |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
return items.Where((t, i) => t.ComponentType != PageLayout.ToolbarItems[i].ComponentType).Any(); |
|
|
|
} |
|
|
|
|
|
|
|
protected async override Task OnInitializedAsync() |
|
|
|
{ |
|
|
|
|