소스 검색

fix(transition): transition is breaking/flickering when enter is canceled (#10688)

Co-authored-by: Vadim Kruglov <vadim.kruglov@libertexgroup.com>
Vadim Kruglov 2 년 전
부모
커밋
65109a70f1
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      packages/runtime-dom/src/components/Transition.ts

+ 3 - 1
packages/runtime-dom/src/components/Transition.ts

@@ -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