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) {
286286 // CSS transitions.
287287 document . hidden ||
288288 // 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 )
290292 ) {
291293 return
292294 }
@@ -336,4 +338,18 @@ p.setupCssCb = function (event, cb) {
336338 _ . on ( el , event , onEnd )
337339}
338340
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+
339355module . exports = Transition
You can’t perform that action at this time.
0 commit comments