3 ms·
This is a simple fix, set the element to display none, add animation listener, and when the animation if finished remove it from the DOM
by halflife 2y ago
This 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.