Closed x9prototype closed 4 months ago
Hi! :wave: Thanks for your issue. You are helping to improve Bootstrap 5 toggle.
Hi,
The issue has not a simple solution. The size of the toggle is calculated when is render. I will try to expose render method, so you can update the render when the parent collapse state change.
The issue occurs also if you are using the script in a modal box. $toggleOn.outerWidth() and .outerHeight() is still 0
Hi @RubbelDeCatc and @x9prototype,
A new API method will be added to the next version that will allow re-rendering the toggle in order it has the appropriated size.
So when the parent element change drastically the appearance (collapse, modals...) you can dispatch the new method from JS.
I know it's a bit late.
Describe the bug A toggle inside of a collapsed element does not work properly.
To Reproduce Steps to reproduce the behavior and minimal code:
I used haml but essentially just place a toggle inside a bootstrap collapsible panel
This generates the following HTML after the page loads
Expected behavior In bootstrap4-toggle, all the toggles would show properly, in this version toggles that are inside a collapse element have incorrect height and width applied and so they show really tiny.
Screenshots
Package: (please complete the following information)
Desktop: (please complete the following information)
Additional context Add any other context about the problem here.