havit / Havit.Blazor

Free Bootstrap 5 components for ASP.NET Blazor + optional enterprise-level stack for Blazor development (gRPC code-first, layered architecture, localization, auth, ...)
https://havit.blazor.eu
MIT License
476 stars 67 forks source link

[HxSidebar] Clicking non-expandable node when MultipleItemsExpansion should collapse current node #864

Open hakenr opened 1 month ago

hakenr commented 1 month ago

The current implementation uses Bootstrap's collapse parent, where setting the parent makes the collapse behave like an accordion (collapsing the other sections under the same parent). However, this doesn't handle scenarios where some nodes aren't expandable (no child nodes). Navigating to such a standalone node should probably cause the currently expanded node to collapse.

cc @alexax578

hakenr commented 1 month ago

For our current PWT project, we will resolve this in derived component. To support such customization, we need to expose (protected virtual) the HandleCollapseShown and HandleCollapseHidden methods (together with already exposed protected bool expanded field).