diff --git a/packages/inula-novdom/src/dom.ts b/packages/inula-novdom/src/dom.ts index 930b5d0e..41af470f 100644 --- a/packages/inula-novdom/src/dom.ts +++ b/packages/inula-novdom/src/dom.ts @@ -169,7 +169,7 @@ function cleanChildren(parent: Node, prevNodes: Node[], marker?: Node, replaceme const el = prevNodes[i]; if (node !== el) { const isParent = el.parentNode === parent; - if (!inserted && !i) { + if (!inserted && i === 0) { isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker); } else { isParent && (el as ChildNode).remove(); diff --git a/packages/inula-novdom/tests/env.test.tsx b/packages/inula-novdom/tests/env.test.tsx index c9f20e18..74e7ac15 100644 --- a/packages/inula-novdom/tests/env.test.tsx +++ b/packages/inula-novdom/tests/env.test.tsx @@ -212,7 +212,7 @@ describe('env', () => { } render(() => $$runComponent(App, {}), container); - expect(container.innerHTML).toBe('