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.