Skip to content

v2.1.2

Choose a tag to compare

@joshwcomeau joshwcomeau released this 28 Apr 01:23
· 227 commits to master since this release

Fix bug with nested transitions

Since its inception, FlipMove has relied on an onTransitionEnd event handler to do some post-flipping cleanup. Specifically, I needed to remove some inline styles (transform, transition) and fire user-specified onFinish handlers.

This works great, except when a nested node also has a transition event, such as a :hover effect.

The problem is, events bubble up. This propagation causes the onTransitionEnd handler to fire prematurely, which causes the parent node to "jump" to its end position pre-maturely, as the cleanup removes the styles that are currently controlling its transition!

Props to @havenchyk for spotting the issue and helping me diagnose with a Codepen :)