diff --git a/src/diff/children.js b/src/diff/children.js index b8fb89cc40..ea317fbb87 100644 --- a/src/diff/children.js +++ b/src/diff/children.js @@ -325,13 +325,12 @@ function placeChild( if (nextDom !== undefined) { oldDom = nextDom; } else { - oldDom = newDom.nextSibling; - } - - // Skip over comment nodes. Will be removed right after calling diffChildren - // in diff so that the vnode tree matches the DOM tree again. - while (oldDom !== null && oldDom.nodeType === 8) { - oldDom = oldDom.nextSibling; + oldDom = newDom; + // Skip over comment nodes. Will be removed right after calling diffChildren + // in diff so that the vnode tree matches the DOM tree again. + do { + oldDom = oldDom.nextSibling; + } while (oldDom !== null && oldDom.nodeType === 8); } return oldDom;