Kaynağa Gözat

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

Evan You 9 yıl önce
ebeveyn
işleme
98876f008b
1 değiştirilmiş dosya ile 5 ekleme ve 3 silme
  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)
     cb()
   }
-  const onEnd = () => {
-    if (++ended >= propCount) {
-      end()
+  const onEnd = e => {
+    if (e.target === el) {
+      if (++ended >= propCount) {
+        end()
+      }
     }
   }
   setTimeout(() => {