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
514 stars 68 forks source link

[HxDropdownToggleElement, HxDropdownToggleButton] Allow customization of options passed to Bootstrap dropdown constructor from Blazor component #875

Closed alexax578 closed 2 months ago

alexax578 commented 2 months ago

I would like to pass custom options to the underlying Bootstrap dropdown component in my own component derived from HxDropdownToggleElement/HxDropdownToggleButton.

Bootstrap dropdown options: https://getbootstrap.com/docs/5.3/components/dropdowns/#options

I also need to be able to extend these options as I work with customized Bootstrap JavaScript.

Proposed solution: Add a virtual method to HxDropdownToggleElement and HxDropdownToggleButton that returns the configuration which will be supplied to the Bootstrap dropdown when it is created.

This pattern could be implemented for other components as well (Modal, Offcanvas, Carousel...) as it would allow for greater customization in components derived from Havit.Blazor components.

hakenr commented 2 months ago

@alexax578 released in 4.6.13-pre2 for testing