How to solve the problem of crunching transitions in Bootstrap collapse.

When using Bootstrap’s collapse component, if the target element has padding, the animation may become choppy.

This is because the transition does not work as expected due to the padding. The solution is to enclose the target element in a new wrapper element and specify collapse on that wrapper element.

This way, when padding is applied to the inner element, the outer wrapper element collapses smoothly, preventing clipping.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top