8000 fix transition hidden check (fix #1781) · cdxfish/vue@01825aa · GitHub
[go: up one dir, main page]

Skip to content

Commit 01825aa

Browse files
committed
fix transition hidden check (fix vuejs#1781)
1 parent 73c2499 commit 01825aa

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

src/directives/public/show.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,8 @@ module.exports = {
1919
},
2020

2121
apply: function (el, value) {
22-
function done () {
22+
transition.apply(el, value ? 1 : -1, function () {
2323
el.style.display = value ? '' : 'none'
24-
}
25-
// do not apply transition if not in doc
26-
if (_.inDoc(el)) {
27-
transition.apply(el, value ? 1 : -1, done, this.vm)
28-
} else {
29-
done()
30-
}
24+
}, this.vm)
3125
}
3226
}

src/transition/transition.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,8 @@ p.setupCssCb = function (event, cb) {
358358

359359
function isHidden (el) {
360360
return !(
361-
el.offsetWidth &&
362-
el.offsetHeight &&
361+
el.offsetWidth ||
362+
el.offsetHeight ||
363363
el.getClientRects().length
364364
)
365365
}

0 commit comments

Comments
 (0)
0