Hacker News new | ask | show | jobs
by abdusco 285 days ago
Even when using view transitions?

https://developer.mozilla.org/en-US/docs/Web/CSS/@starting-s...

1 comments

The "Transitioning elements on DOM addition and removal" example in that article uses a setTimeout() to wait an extra 1000 milliseconds before removing the element from the DOM. If you immediately remove the element from the DOM (like would usually happen if you do {isOpen && <Modal />} in React), it'll vanish immediately and won't have time to play the transition.