From 5e1f5f0fac53e3e1af077a79419beb577d055004 Mon Sep 17 00:00:00 2001 From: Robert Haken Date: Mon, 5 Aug 2024 14:10:32 +0200 Subject: [PATCH] #864 [HxSidebar] Clicking non-expandable node when MultipleItemsExpansion should collapse current node - exposing seams for custom solution --- .../Navigation/HxSidebarItem.razor.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Havit.Blazor.Components.Web.Bootstrap/Navigation/HxSidebarItem.razor.cs b/Havit.Blazor.Components.Web.Bootstrap/Navigation/HxSidebarItem.razor.cs index 4200750bc..4d1305424 100644 --- a/Havit.Blazor.Components.Web.Bootstrap/Navigation/HxSidebarItem.razor.cs +++ b/Havit.Blazor.Components.Web.Bootstrap/Navigation/HxSidebarItem.razor.cs @@ -114,14 +114,16 @@ protected override async Task OnAfterRenderAsync(bool firstRender) } } - private void HandleCollapseShown() + protected virtual Task HandleCollapseShown() { expanded = true; + return Task.CompletedTask; } - private void HandleCollapseHidden() + protected virtual Task HandleCollapseHidden() { expanded = false; + return Task.CompletedTask; } // Bootstrap Collapse (data-bs-toggle="collapse") prevents default action (navigation) on click