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
486 stars 67 forks source link

[HxSidebar] HxSidebarItem.OnClick event #837

Open franky1017 opened 3 months ago

franky1017 commented 3 months ago

I am using the HxSidebar component and instead of linking to a page, I would like to set the OnClick event of the HxSidebarItem. But I was not able to find such event. Is this by design?

crdo commented 3 months ago

Yes, it is not there by design.

hakenr commented 3 months ago

@franky1017 What would you like to achieve with HxSidebarItem.OnClick?

franky1017 commented 3 months ago

I am using the sidebar as a list and when clicking on it, the right panel would show details of the item.

I’ve switched to use list but I just love the look and feel of the sidebar with auto hide and mobile menu features.

On Mon, Jun 24, 2024 at 4:45 AM Robert Haken @.***> wrote:

@franky1017 https://github.com/franky1017 What would you like to achieve with HxSidebarItem.OnClick?

— Reply to this email directly, view it on GitHub https://github.com/havit/Havit.Blazor/issues/837#issuecomment-2185946302, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJETLLL7QHWZ3JDWWXQWOI3ZI7MEHAVCNFSM6AAAAABJVUMLRGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBVHE2DMMZQGI . You are receiving this because you were mentioned.Message ID: <havit/Havit .@.***>

hakenr commented 2 months ago

Although I understand your scenario, the HxSidebar is still a very specific and complex component designed solely for the main navigation of the entire application. There are many other issues you might encounter if you try to use it differently.

I’ll take your feedback into account if we decide to do a major overhaul of the sidebar component.

hakenr commented 3 weeks ago

In the end, we decided to reconsider the original approach. For advanced scenarios where specific logic is needed in the OnClick event, we will add new parameters to HxSidebarItem:

Hopefully, this won't cause more confusion than it brings utility.