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