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 @@ -288,7 +288,9 @@ p.getCssTransitionType = function (className) {
288288 // CSS transitions.
289289 document . hidden ||
290290 // 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 )
292294 ) {
293295 return
294296 }
@@ -338,4 +340,18 @@ p.setupCssCb = function (event, cb) {
338340 _ . on ( el , event , onEnd )
339341}
340342
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+
341357module . exports = Transition
You can’t perform that action at this time.
0 commit comments