test: add tests for rendererChildren (#52)
* test: [wip] add tests for rendererChildren * chore: use serializeInner for clearer output * fix: should remove the text node if content is empty * test: also test for appended content * test: inserting & removing * test: moving children * refactor: use a helper function * test: finish tests * test: duplicate keys tests belong to keyed children block * fix(runtime-test): fix insert when moving node in the same parent * fix: fix failing test cases for rendererChildren * test: handle rendererChildren edge case
This commit is contained in:
@@ -1512,7 +1512,10 @@ export function createRenderer<
|
||||
} else {
|
||||
// key-less node, try to locate a key-less node of the same type
|
||||
for (j = s2; j <= e2; j++) {
|
||||
if (isSameType(prevChild, c2[j] as HostVNode)) {
|
||||
if (
|
||||
newIndexToOldIndexMap[j - s2] === 0 &&
|
||||
isSameType(prevChild, c2[j] as HostVNode)
|
||||
) {
|
||||
newIndex = j
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user