]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(transition): transition is breaking/flickering when enter is canceled (#10688)
authorVadim Kruglov <49036220+quiteeasy@users.noreply.github.com>
Mon, 22 Apr 2024 07:10:08 +0000 (14:10 +0700)
committerGitHub <noreply@github.com>
Mon, 22 Apr 2024 07:10:08 +0000 (15:10 +0800)
Co-authored-by: Vadim Kruglov <vadim.kruglov@libertexgroup.com>
packages/runtime-dom/src/components/Transition.ts

index cce247fe1aebe257d744b01295a850c1d63a2b43..71385926d7bdbf35df2ba05c27b94286d211ead2 100644 (file)
@@ -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