4 ms·
Animating to height: auto is a welcome addition, but I'm afraid that exit animations will still be a problem since Frameworks usually remove the element from th
by SebastianKra 2y ago
Animating to height: auto is a welcome addition, but I'm afraid that exit animations will still be a problem since Frameworks usually remove the element from the DOM rather than setting display: none.
- halflife 2y agoThis is a simple fix, set the element to display none, add animation listener, and when the animation if finished remove it from the DOM
- SebastianKra 2y agoIt's also easy without this feature. You just reduce the opacity and then remove the elements. The issue is that this approach somewhat clashes with the declarative and reactive rendering approach of most frontend frameworks. The UI is no longer a function of state, but needs to account for whatever animations are going on. Solving this would probably need some coordination between the DOM and framework developers. Like an Element.animateExit() function that React et al. can call.