Skip to content

Commit

Permalink
less agressive fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Feb 17, 2024
1 parent 00b71c4 commit 94b0563
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/diff/children.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ function constructNewChildrenArray(newParentVNode, renderResult, oldChildren) {
) {
if (oldVNode._dom == newParentVNode._nextDom) {
newParentVNode._nextDom = getDomSibling(oldVNode);
} else {
skew++;
}
unmount(oldVNode, oldVNode, false);

Expand All @@ -252,7 +254,6 @@ function constructNewChildrenArray(newParentVNode, renderResult, oldChildren) {
// assume DOM nodes in this subtree are mounted and usable.
oldChildren[i] = null;
remainingOldChildren--;
skew++;
}
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion test/browser/fragments.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,7 @@ describe('Fragment', () => {
'rendering from true to false'
);
expectDomLogToBe(
['<li>1.remove()', '<li>2.remove()'],
['<li>1.remove()', '<li>2.remove()', '<ol>043.appendChild(<li>4)'],
'rendering from true to false'
);

Expand Down

0 comments on commit 94b0563

Please sign in to comment.