fix(runtime-dom): patch textContent on svg properly (#4301)

fix #4296
This commit is contained in:
edison
2021-08-11 22:53:54 +08:00
committed by GitHub
parent 1ce34e25d5
commit e7b0a9d3cf
2 changed files with 9 additions and 2 deletions

View File

@@ -10,6 +10,13 @@ describe('runtime-dom: attrs patching', () => {
expect(el.getAttributeNS(xlinkNS, 'href')).toBe(null)
})
test('textContent attributes /w svg', () => {
const el = document.createElementNS('http://www.w3.org/2000/svg', 'use')
patchProp(el, 'textContent', null, 'foo', true)
expect(el.attributes.length).toBe(0)
expect(el.innerHTML).toBe('foo')
})
test('boolean attributes', () => {
const el = document.createElement('input')
patchProp(el, 'readonly', null, true)