We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 930c7f0 commit 9139fc8Copy full SHA for 9139fc8
src/transition/transition.js
@@ -288,7 +288,9 @@ p.getCssTransitionType = function (className) {
288
// CSS transitions.
289
document.hidden ||
290
// explicit js-only transition
291
- (this.hooks && this.hooks.css === false)
+ (this.hooks && this.hooks.css === false) ||
292
+ // element is hidden
293
+ isHidden(this.el)
294
) {
295
return
296
}
@@ -338,4 +340,18 @@ p.setupCssCb = function (event, cb) {
338
340
_.on(el, event, onEnd)
339
341
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
357
module.exports = Transition
0 commit comments