From 9f22594e0899148663203ab00ac37699cfdc4e71 Mon Sep 17 00:00:00 2001 From: Guido Bouman Date: Thu, 13 Oct 2016 11:48:23 +0200 Subject: [PATCH 1/2] Fix using one delay to control all transitions. Vue transitions have wrong timing when having CSS like the following: ``` .[transition-name]-enter-active, .[transition-name]-leave-active { transition: opacity 0.8s ease, transform 0.7s ease; transition-delay: 0.4s; } ``` Which in turn bubbles errors to the console. --- src/platforms/web/runtime/transition-util.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/platforms/web/runtime/transition-util.js b/src/platforms/web/runtime/transition-util.js index 4883cd6fc8c..93c97c09a56 100644 --- a/src/platforms/web/runtime/transition-util.js +++ b/src/platforms/web/runtime/transition-util.js @@ -131,6 +131,10 @@ export function getTransitionInfo (el: Element, expectedType?: ?string): { } function getTimeout (delays: Array, durations: Array): number { + while(delays.length < durations.length) { + delays = delays.concat(delays); + } + return Math.max.apply(null, durations.map((d, i) => { return toMs(d) + toMs(delays[i]) })) From 2422b1a9c03f22bc430cb0913666e835e0650ff2 Mon Sep 17 00:00:00 2001 From: Guido Bouman Date: Thu, 13 Oct 2016 11:56:55 +0200 Subject: [PATCH 2/2] Fix linting. --- src/platforms/web/runtime/transition-util.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/platforms/web/runtime/transition-util.js b/src/platforms/web/runtime/transition-util.js index 93c97c09a56..416d72cfbc0 100644 --- a/src/platforms/web/runtime/transition-util.js +++ b/src/platforms/web/runtime/transition-util.js @@ -131,10 +131,10 @@ export function getTransitionInfo (el: Element, expectedType?: ?string): { } function getTimeout (delays: Array, durations: Array): number { - while(delays.length < durations.length) { - delays = delays.concat(delays); + while (delays.length < durations.length) { + delays = delays.concat(delays) } - + return Math.max.apply(null, durations.map((d, i) => { return toMs(d) + toMs(delays[i]) }))