Skip to content

Commit 8f0e46c

Browse files
yyx990803hefeng
authored and
hefeng
committed
fix: work around old Chrome bug
fix vuejs#6601
1 parent 34af9fa commit 8f0e46c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

+5
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)