Просмотр исходного кода

ensure transition end detection only count events triggered on target element (fix #3506)

Evan You 9 лет назад
Родитель
Сommit
98876f008b
1 измененных файлов с 5 добавлено и 3 удалено
  1. 5 3
      src/platforms/web/runtime/transition-util.js

+ 5 - 3
src/platforms/web/runtime/transition-util.js

@@ -60,9 +60,11 @@ export function whenTransitionEnds (
     el.removeEventListener(event, onEnd)
     el.removeEventListener(event, onEnd)
     cb()
     cb()
   }
   }
-  const onEnd = () => {
-    if (++ended >= propCount) {
-      end()
+  const onEnd = e => {
+    if (e.target === el) {
+      if (++ended >= propCount) {
+        end()
+      }
     }
     }
   }
   }
   setTimeout(() => {
   setTimeout(() => {