diff --git a/src/diff/children.js b/src/diff/children.js index e55fc97017f..b759a34f556 100644 --- a/src/diff/children.js +++ b/src/diff/children.js @@ -205,17 +205,6 @@ export function diffChildren( // Remove remaining oldChildren if there are any. for (i = oldChildrenLength; i--; ) { if (oldChildren[i] != null) { - if ( - typeof newParentVNode.type == 'function' && - oldChildren[i]._dom != null && - oldChildren[i]._dom == newParentVNode._nextDom - ) { - // If the newParentVNode.__nextDom points to a dom node that is about to - // be unmounted, then get the next sibling of that vnode and set - // _nextDom to it - newParentVNode._nextDom = getDomSibling(oldParentVNode, i + 1); - } - unmount(oldChildren[i], oldChildren[i]); } } diff --git a/test/browser/fragments.test.js b/test/browser/fragments.test.js index 882aeed9550..a5d92c7998a 100644 --- a/test/browser/fragments.test.js +++ b/test/browser/fragments.test.js @@ -237,7 +237,9 @@ describe('Fragment', () => { expectDomLogToBe([ '
1. Original item first paragraph
+2. Original item second paragraph
+ +1. Second item first paragraph
+2. Second item second paragraph
+ +1. Original item first paragraph
2. Original item second paragraph
' + ); + + swap(); + rerender(); + expect(scratch.innerHTML).to.equal( + '1. Second item first paragraph
2. Second item second paragraph
' + ); + + swap(); + rerender(); + expect(scratch.innerHTML).to.equal( + '1. Original item first paragraph
2. Original item second paragraph
' + ); + }); });