File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -286,7 +286,9 @@ p.getCssTransitionType = function (className) {
286
286
// CSS transitions.
287
287
document . hidden ||
288
288
// explicit js-only transition
289
- ( this . hooks && this . hooks . css === false )
289
+ ( this . hooks && this . hooks . css === false ) ||
290
+ // element is hidden
291
+ isHidden ( this . el )
290
292
) {
291
293
return
292
294
}
@@ -336,4 +338,18 @@ p.setupCssCb = function (event, cb) {
336
338
_ . on ( el , event , onEnd )
337
339
}
338
340
341
+ /**
342
+ * Check if an element is hidden - in that case we can just
343
+ * skip the transition alltogether.
344
+ *
345
+ * @param {Element } el
346
+ * @return {Boolean }
347
+ */
348
+
349
+ function isHidden ( el ) {
350
+ return el . style . display === 'none' ||
351
+ el . style . visibility === 'hidden' ||
352
+ el . hidden
353
+ }
354
+
339
355
module . exports = Transition
You can’t perform that action at this time.
0 commit comments