@@ -126,7 +126,11 @@ function applyTransitionClass (el, stage, changeState, hasAnimation) {
if (el.offsetWidth || el.offsetHeight) {
// trigger hide transition
- classList.add(leaveClass)
+ batcher.push({
+ execute: function () {
+ classList.add(leaveClass)
+ }
+ })
onEnd = function (e) {
if (e.target === el) {
el.removeEventListener(endEvent, onEnd)
@@ -176,8 +176,11 @@ describe('Transition', function () {
assert.ok(typeof el.vue_trans_cb === 'function')
})
- it('should add the class', function () {
- assert.ok(el.classList.contains(leaveClass))
+ it('should add the class', function (done) {
+ nextTick(function () {
+ assert.ok(el.classList.contains(leaveClass))
+ done()
it('should call changeState on transitionend', function () {