File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -411,10 +411,10 @@ const vFor = {
411
411
var moving = node . _pendingMoveCb
412
412
var type
413
413
if ( ! moving ) {
414
- // sniff whether element has a transition duration
414
+ // sniff whether element has a transition duration for transform
415
415
// with the move class applied
416
416
addClass ( node , moveClass )
417
- type = transition . getCssTransitionType ( moveClass )
417
+ type = transition . getCssTransitionType ( moveClass , true )
418
418
removeClass ( node , moveClass )
419
419
}
420
420
if ( moving || type === TYPE_TRANSITION ) {
Original file line number Diff line number Diff line change @@ -15,8 +15,8 @@ import {
15
15
16
16
export const TYPE_TRANSITION = 'transition'
17
17
export const TYPE_ANIMATION = 'animation'
18
- export const transDurationProp = transitionProp + 'Duration'
19
- export const animDurationProp = animationProp + 'Duration'
18
+ const transDurationProp = transitionProp + 'Duration'
19
+ const animDurationProp = animationProp + 'Duration'
20
20
21
21
/**
22
22
* A Transition object that encapsulates the state and logic
@@ -306,10 +306,11 @@ p.callHookWithCb = function (type) {
306
306
* calculated styles.
307
307
*
308
308
* @param {String } className
309
- * @return {Number }
309
+ * @param {Boolean } expectTransform
310
+ * @return {String }
310
311
*/
311
312
312
- p . getCssTransitionType = function ( className ) {
313
+ p . getCssTransitionType = function ( className , expectTransform ) {
313
314
/* istanbul ignore if */
314
315
if (
315
316
! transitionEndEvent ||
@@ -330,6 +331,15 @@ p.getCssTransitionType = function (className) {
330
331
if ( type ) return type
331
332
var inlineStyles = this . el . style
332
333
var computedStyles = window . getComputedStyle ( this . el )
334
+
335
+ // check if `transform` is among the transitioned properties
336
+ if ( expectTransform ) {
337
+ var transitionProperties = computedStyles [ transitionProp + 'Property' ]
338
+ if ( ! / \b t r a n s f o r m ( , | $ ) / . test ( transitionProperties ) ) {
339
+ return
340
+ }
341
+ }
4CF6
342
+
333
343
var transDuration =
334
344
inlineStyles [ transDurationProp ] ||
335
345
computedStyles [ transDurationProp ]
You can’t perform that action at this time.
0 commit comments