Skip to content

Commit 1e01c18

Browse files
committed
fix vuejs#394 transition gaps
1 parent eb4d010 commit 1e01c18

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/transition.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,11 @@ function applyTransitionClass (el, stage, changeState, hasAnimation) {
126126

127127
if (el.offsetWidth || el.offsetHeight) {
128128
// trigger hide transition
129-
classList.add(leaveClass)
129+
batcher.push({
130+
execute: function () {
131+
classList.add(leaveClass)
132+
}
133+
})
130134
onEnd = function (e) {
131135
if (e.target === el) {
132136
el.removeEventListener(endEvent, onEnd)

test/unit/specs/transition.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,11 @@ describe('Transition', function () {
176176
assert.ok(typeof el.vue_trans_cb === 'function')
177177
})
178178

179-
it('should add the class', function () {
180-
assert.ok(el.classList.contains(leaveClass))
179+
it('should add the class', function (done) {
180+
nextTick(function () {
181+
assert.ok(el.classList.contains(leaveClass))
182+
done()
183+
})
181184
})
182185

183186
it('should call changeState on transitionend', function () {

0 commit comments

Comments
 (0)