Skip to content

Commit

Permalink
fix(transition): transition is breaking/flickering when enter is canc…
Browse files Browse the repository at this point in the history
…eled (#10688)

Co-authored-by: Vadim Kruglov <[email protected]>
  • Loading branch information
quiteeasy and Vadim Kruglov authored Apr 22, 2024
1 parent 88c9d26 commit 65109a7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/runtime-dom/src/components/Transition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,11 @@ export function resolveTransitionProps(
if (__COMPAT__ && legacyClassEnabled && legacyLeaveFromClass) {
addTransitionClass(el, legacyLeaveFromClass)
}
// add *-leave-active class before reflow so in the case of a cancelled enter transition
// the css will not get the final state (#10677)
addTransitionClass(el, leaveActiveClass)
// force reflow so *-leave-from classes immediately take effect (#2593)
forceReflow()
addTransitionClass(el, leaveActiveClass)
nextFrame(() => {
if (!el._isLeaving) {
// cancelled
Expand Down

0 comments on commit 65109a7

Please sign in to comment.