LearnNewsExamplesServices
Frontmatter
id8627
titleFragment hidden config fails: removeNode delta missing parentId
stateClosed
labels
bugaicore
assigneestobiu
createdAtJan 14, 2026, 1:48 AM
updatedAtJan 14, 2026, 1:49 AM
githubUrlhttps://github.com/neomjs/neo/issues/8627
authortobiu
commentsCount1
parentIssue8601
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 14, 2026, 1:49 AM

Fragment hidden config fails: removeNode delta missing parentId

Closed v11.21.0 bugaicore
tobiu
tobiu commented on Jan 14, 2026, 1:48 AM

The hidden config on a Neo.container.Fragment (which sets removeDom: true on the VDOM node) fails to remove the Fragment from the DOM.

Root Cause: Neo.vdom.Helper.removeNode only includes the parentId in the delta for vtype: 'text' nodes. However, Neo.main.DeltaUpdates.removeNode requires parentId to locate and remove Fragments (since they consist of start/end comment anchors and don't have a single element ID to look up).

Symptoms:

  • Setting hidden: true on a Fragment does nothing (DOM remains).
  • Setting hidden: false afterwards causes duplication (new content inserted, old content remains).

Fix: Update Neo.vdom.Helper.removeNode to include parentId in the delta if the node is a Fragment (nodeName === 'fragment').

tobiu added the bug label on Jan 14, 2026, 1:48 AM
tobiu added the ai label on Jan 14, 2026, 1:48 AM
tobiu added the core label on Jan 14, 2026, 1:48 AM
tobiu added parent issue #8601 on Jan 14, 2026, 1:49 AM
tobiu referenced in commit b790098 - "fix(VDOM): Include parentId in removeNode delta for Fragments (#8627)" on Jan 14, 2026, 1:49 AM
tobiu assigned to @tobiu on Jan 14, 2026, 1:49 AM
tobiu
tobiu Jan 14, 2026, 1:49 AM

Input from Gemini 3 Pro:

✦ I have fixed the issue where Neo.container.Fragment hidden: true config would fail to remove the DOM nodes.

Fix Details:

  • File: src/vdom/Helper.mjs
  • Change: Updated removeNode to include the parentId in the delta when the node is a Fragment (nodeName === 'fragment'). This allows Neo.main.DeltaUpdates to correctly locate the fragment anchors for removal.

Verification:

  • Created a new unit test test/playwright/unit/vdom/FragmentHidden.spec.mjs which verifies that the removeNode delta for a Fragment includes the parentId and that the subsequent insertNode delta is correct.

Changes committed and pushed.

tobiu closed this issue on Jan 14, 2026, 1:49 AM
tobiu cross-referenced by #8616 on Jan 14, 2026, 1:51 AM
tobiu cross-referenced by #8625 on Jan 14, 2026, 1:59 AM