Skip to content

Commit f802317

Browse files
Dexter Miguelyyx990803
authored andcommitted
destroyed elements pass their styles onto others that are similar (vuejs#4232)
1 parent cd0e373 commit f802317

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/unit/features/directives/style.spec.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,4 +277,22 @@ describe('Directive v-bind:style', () => {
277277
expect(style.marginLeft).toBe('40px')
278278
}).then(done)
279279
})
280+
281+
it('should not merge for different adjacent elements', (done) => {
282+
const vm = new Vue({
283+
template: '<div>' +
284+
'<section style="color: blue" v-if="!bool"></section>' +
285+
'<div></div>' +
286+
'<section style="margin: 0" v-if="bool"></section>' +
287+
'</div>',
288+
data: {
289+
bool: false
290+
}
291+
}).$mount()
292+
waitForUpdate(() => {
293+
vm.bool = true
294+
}).then(() => {
295+
expect(vm.$el.children[1].style.color).not.toBe('blue')
296+
}).then(done)
297+
})
280298
})

0 commit comments

Comments
 (0)