Skip to content

Commit 0bb2d4e

Browse files
committed
Revert "fix enter transition flicker regression (fix #4576)"
This reverts commit 89987e8.
1 parent 2540c37 commit 0bb2d4e

File tree

5 files changed

+47
-47
lines changed

5 files changed

+47
-47
lines changed

src/platforms/web/runtime/modules/transition.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ export function enter (vnode: VNodeWithData, toggleDisplay: ?() => void) {
112112
beforeEnterHook && beforeEnterHook(el)
113113
if (expectsCSS) {
114114
addTransitionClass(el, startClass)
115-
addTransitionClass(el, activeClass)
116115
nextFrame(() => {
117116
removeTransitionClass(el, startClass)
117+
addTransitionClass(el, activeClass)
118118
if (!cb.cancelled && !userWantsControl) {
119119
whenTransitionEnds(el, type, cb)
120120
}

test/unit/features/component/component-keep-alive.spec.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ describe('Component keep-alive', () => {
295295
expect(vm.$el.innerHTML).toBe('<!---->')
296296
}).thenWaitFor(nextFrame).then(() => {
297297
expect(vm.$el.innerHTML).toBe(
298-
'<div class="test test-enter test-enter-active">two</div>'
298+
'<div class="test test-enter">two</div>'
299299
)
300300
assertHookCalls(one, [1, 1, 1, 1, 0])
301301
assertHookCalls(two, [1, 1, 1, 0, 0])
@@ -325,7 +325,7 @@ describe('Component keep-alive', () => {
325325
expect(vm.$el.innerHTML).toBe('<!---->')
326326
}).thenWaitFor(nextFrame).then(() => {
327327
expect(vm.$el.innerHTML).toBe(
328-
'<div class="test test-enter test-enter-active">one</div>'
328+
'<div class="test test-enter">one</div>'
329329
)
330330
assertHookCalls(one, [1, 1, 2, 1, 0])
331331
assertHookCalls(two, [1, 1, 1, 1, 0])
@@ -369,7 +369,7 @@ describe('Component keep-alive', () => {
369369
waitForUpdate(() => {
370370
expect(vm.$el.innerHTML).toBe(
371371
'<div class="test">one</div>' +
372-
'<div class="test test-enter test-enter-active">two</div>'
372+
'<div class="test test-enter">two</div>'
373373
)
374374
assertHookCalls(one, [1, 1, 1, 1, 0])
375375
assertHookCalls(two, [1, 1, 1, 0, 0])
@@ -404,7 +404,7 @@ describe('Component keep-alive', () => {
404404
}).then(() => {
405405
expect(vm.$el.innerHTML).toBe(
406406
'<div class="test">two</div>' +
407-
'<div class="test test-enter test-enter-active">one</div>'
407+
'<div class="test test-enter">one</div>'
408408
)
409409
assertHookCalls(one, [1, 1, 2, 1, 0])
410410
assertHookCalls(two, [1, 1, 1, 1, 0])
@@ -460,7 +460,7 @@ describe('Component keep-alive', () => {
460460
waitForUpdate(() => {
461461
expect(vm.$el.innerHTML).toBe(
462462
'<div class="test">one</div>' +
463-
'<div class="test test-enter test-enter-active">two</div>'
463+
'<div class="test test-enter">two</div>'
464464
)
465465
}).thenWaitFor(nextFrame).then(() => {
466466
expect(vm.$el.innerHTML).toBe(
@@ -476,7 +476,7 @@ describe('Component keep-alive', () => {
476476
// 3. a new "one" is created and entering
477477
expect(vm.$el.innerHTML).toBe(
478478
'<div class="test">two</div>' +
479-
'<div class="test test-enter test-enter-active">one</div>'
479+
'<div class="test test-enter">one</div>'
480480
)
481481
}).thenWaitFor(nextFrame).then(() => {
482482
expect(vm.$el.innerHTML).toBe(
@@ -528,7 +528,7 @@ describe('Component keep-alive', () => {
528528
waitForUpdate(() => {
529529
expect(vm.$el.innerHTML).toBe(
530530
'<div class="test v-leave">foo</div>' +
531-
'<div class="test test-enter test-enter-active">bar</div>'
531+
'<div class="test test-enter">bar</div>'
532532
)
533533
}).thenWaitFor(nextFrame).then(() => {
534534
expect(vm.$el.innerHTML).toBe(
@@ -543,7 +543,7 @@ describe('Component keep-alive', () => {
543543
}).then(() => {
544544
expect(vm.$el.innerHTML).toBe(
545545
'<div class="test test-leave">bar</div>' +
546-
'<div class="test v-enter v-enter-active">foo</div>'
546+
'<div class="test v-enter">foo</div>'
547547
)
548548
}).thenWaitFor(nextFrame).then(() => {
549549
expect(vm.$el.innerHTML).toBe(

test/unit/features/transition/transition-group.spec.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ if (!isIE9) {
4343
expect(vm.$el.innerHTML).toBe(
4444
`<span>` +
4545
['a', 'b', 'c'].map(i => `<div class="test">${i}</div>`).join('') +
46-
`<div class="test v-enter v-enter-active">d</div>` +
47-
`<div class="test v-enter v-enter-active">e</div>` +
46+
`<div class="test v-enter">d</div>` +
47+
`<div class="test v-enter">e</div>` +
4848
`</span>`
4949
)
5050
}).thenWaitFor(nextFrame).then(() => {
@@ -101,7 +101,7 @@ if (!isIE9) {
101101
`<div class="test v-leave">a</div>` +
102102
`<div class="test">b</div>` +
103103
`<div class="test">c</div>` +
104-
`<div class="test v-enter v-enter-active">d</div>` +
104+
`<div class="test v-enter">d</div>` +
105105
`</span>`
106106
)
107107
}).thenWaitFor(nextFrame).then(() => {
@@ -131,7 +131,7 @@ if (!isIE9) {
131131
`<div class="test v-leave">a</div>` +
132132
`<div class="test">b</div>` +
133133
`<div class="test">c</div>` +
134-
`<div class="test v-enter v-enter-active">d</div>` +
134+
`<div class="test v-enter">d</div>` +
135135
`</span>`
136136
)
137137
}).thenWaitFor(nextFrame).then(() => {
@@ -157,7 +157,7 @@ if (!isIE9) {
157157
waitForUpdate(() => {
158158
expect(vm.$el.innerHTML).toBe(
159159
`<span>` +
160-
vm.items.map(i => `<div class="test v-enter v-enter-active">${i}</div>`).join('') +
160+
vm.items.map(i => `<div class="test v-enter">${i}</div>`).join('') +
161161
`</span>`
162162
)
163163
}).thenWaitFor(nextFrame).then(() => {
@@ -216,7 +216,7 @@ if (!isIE9) {
216216
`<div class="test">a</div>` +
217217
`<div class="test">b</div>` +
218218
`<div class="test">c</div>` +
219-
`<div class="test v-enter v-enter-active">d</div>` +
219+
`<div class="test v-enter">d</div>` +
220220
`</span>`
221221
)
222222
expect(beforeEnterSpy.calls.count()).toBe(1)
@@ -270,7 +270,7 @@ if (!isIE9) {
270270
waitForUpdate(() => {
271271
expect(vm.$el.innerHTML.replace(/\s?style=""(\s?)/g, '$1')).toBe(
272272
`<span>` +
273-
`<div class="test group-enter group-enter-active">d</div>` +
273+
`<div class="test group-enter">d</div>` +
274274
`<div class="test">b</div>` +
275275
`<div class="test group-move">a</div>` +
276276
`<div class="test group-leave group-move">c</div>` +

test/unit/features/transition/transition-mode.spec.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ if (!isIE9) {
3333
waitForUpdate(() => {
3434
expect(vm.$el.innerHTML).toBe(
3535
'<div class="test v-leave">one</div>' +
36-
'<div class="test v-enter v-enter-active">two</div>'
36+
'<div class="test v-enter">two</div>'
3737
)
3838
}).thenWaitFor(nextFrame).then(() => {
3939
expect(vm.$el.innerHTML).toBe(
@@ -78,7 +78,7 @@ if (!isIE9) {
7878
expect(vm.$el.innerHTML).toBe('<!---->')
7979
}).thenWaitFor(nextFrame).then(() => {
8080
expect(vm.$el.innerHTML).toBe(
81-
'<div class="test test-enter test-enter-active">two</div>'
81+
'<div class="test test-enter">two</div>'
8282
)
8383
}).thenWaitFor(nextFrame).then(() => {
8484
expect(vm.$el.innerHTML).toBe(
@@ -126,7 +126,7 @@ if (!isIE9) {
126126
expect(vm.$el.innerHTML).toBe('<!---->')
127127
}).thenWaitFor(nextFrame).then(() => {
128128
expect(vm.$el.innerHTML).toBe(
129-
'<div class="test test-enter test-enter-active">two</div>'
129+
'<div class="test test-enter">two</div>'
130130
)
131131
}).thenWaitFor(nextFrame).then(() => {
132132
expect(vm.$el.innerHTML).toBe(
@@ -161,7 +161,7 @@ if (!isIE9) {
161161
waitForUpdate(() => {
162162
expect(vm.$el.innerHTML).toBe(
163163
'<div class="test">one</div>' +
164-
'<div class="test test-enter test-enter-active">two</div>'
164+
'<div class="test test-enter">two</div>'
165165
)
166166
}).thenWaitFor(nextFrame).then(() => {
167167
expect(vm.$el.innerHTML).toBe(
@@ -211,7 +211,7 @@ if (!isIE9) {
211211
waitForUpdate(() => {
212212
expect(vm.$el.innerHTML).toBe(
213213
'<div class="test">one</div>' +
214-
'<div class="test test-enter test-enter-active">two</div>'
214+
'<div class="test test-enter">two</div>'
215215
)
216216
}).thenWaitFor(nextFrame).then(() => {
217217
expect(vm.$el.innerHTML).toBe(
@@ -227,7 +227,7 @@ if (!isIE9) {
227227
// 3. a new "one" is created and entering
228228
expect(vm.$el.innerHTML).toBe(
229229
'<div class="test">two</div>' +
230-
'<div class="test test-enter test-enter-active">one</div>'
230+
'<div class="test test-enter">one</div>'
231231
)
232232
}).thenWaitFor(nextFrame).then(() => {
233233
expect(vm.$el.innerHTML).toBe(
@@ -271,7 +271,7 @@ if (!isIE9) {
271271
waitForUpdate(() => {
272272
expect(vm.$el.innerHTML).toBe(
273273
'<div class="test v-leave">one</div>' +
274-
'<div class="test v-enter v-enter-active">two</div>'
274+
'<div class="test v-enter">two</div>'
275275
)
276276
}).thenWaitFor(nextFrame).then(() => {
277277
expect(vm.$el.innerHTML).toBe(
@@ -315,7 +315,7 @@ if (!isIE9) {
315315
expect(vm.$el.innerHTML).toBe('<!---->')
316316
}).thenWaitFor(nextFrame).then(() => {
317317
expect(vm.$el.innerHTML).toBe(
318-
'<div class="test test-enter test-enter-active">two</div>'
318+
'<div class="test test-enter">two</div>'
319319
)
320320
}).thenWaitFor(nextFrame).then(() => {
321321
expect(vm.$el.innerHTML).toBe(
@@ -349,7 +349,7 @@ if (!isIE9) {
349349
waitForUpdate(() => {
350350
expect(vm.$el.innerHTML).toBe(
351351
'<div class="test">one</div>' +
352-
'<div class="test test-enter test-enter-active">two</div>'
352+
'<div class="test test-enter">two</div>'
353353
)
354354
}).thenWaitFor(nextFrame).then(() => {
355355
expect(vm.$el.innerHTML).toBe(

0 commit comments

Comments
 (0)