I have a Bootstrap (4) centered Modal with a fixed width and dynamic height based on the content within the modal (the default behavior).
Inside the modal, I have several divs that will be hidden or shown based on some conditions. The text inside the modal also change, and can be longer than expected. I don't know which of these components will be visible or what will be hidden, so the height can't be fixed.
Right now when a components is set as hidden the modal instantly changes its height. I want to use CSS transitions to smoothly change the height of the modal.
I have tried to apply this CSS, without success:
.modal {
transition: height 1s !important;
}
Surely I'm missing something due to my limited knowledge of the CSS animator. How can I apply a smooth transition?