Skip to content

Commit 4d1f14a

Browse files
yyx990803ztlevi
authored andcommitted
fix: work around old Chrome bug
fix vuejs#6601
1 parent 8ebc1c1 commit 4d1f14a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/platforms/web/runtime/modules/dom-props.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ function updateDOMProps (oldVnode: VNodeWithData, vnode: VNodeWithData) {
2828
if (key === 'textContent' || key === 'innerHTML') {
2929
if (vnode.children) vnode.children.length = 0
3030
if (cur === oldProps[key]) continue
31+
// #6601 work around Chrome version <= 55 bug where single textNode
32+
// replaced by innerHTML/textContent retains its parentNode property
33+
if (elm.childNodes.length === 1) {
34+
elm.removeChild(elm.childNodes[0])
35+
}
3136
}
3237

3338
if (key === 'value') {

0 commit comments

Comments
 (0)