Skip to content

Commit 0741e30

Browse files
committed
fix: clear text-list nodes when pure-host path takes over a child slot
The pure-host branch in childSlot checked state.block and state.text before calling clearChildContent, but did not check state.texts. After a lazily loaded factory installs CHILD_LISTS, a hole that still holds a text list could receive an unkeyed host element. The new host mounted and the previous text-list DOM nodes remained in the document. Add state.texts to the guard, matching the text/empty path which already includes it.
1 parent e41ff79 commit 0741e30

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎packages/octane/src/runtime/child-slots.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,8 @@ export function childSlot(
11271127
// Pure host/text → reconcile in place, REUSING the existing node so DOM
11281128
// state survives a re-render. Switching in from a component/text first
11291129
// tears that down (also nulls a stale hostNode).
1130-
if (state.block !== null || state.text !== null) clearChildContent(state);
1130+
if (state.block !== null || state.text !== null || state.texts !== null)
1131+
clearChildContent(state);
11311132
if (state.end === null) {
11321133
// ANCHORLESS: no markers — the element self-delimits, so reconcile
11331134
// straight against the tracked node. A same-tag value patches it in

0 commit comments

Comments
 (0)