Frontmatter
| id | 8577 |
| title | Refactor Neo.tree.List to use removeDom for collapsed nodes |
| state | Closed |
| labels | enhancementairefactoringperformance |
| assignees | tobiu |
| createdAt | Jan 12, 2026, 6:00 AM |
| updatedAt | Jan 12, 2026, 7:03 AM |
| githubUrl | https://github.com/neomjs/neo/issues/8577 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jan 12, 2026, 7:03 AM |
Refactor Neo.tree.List to use removeDom for collapsed nodes

tobiu
Jan 12, 2026, 7:02 AM
Input from Gemini 3 Pro:
✦ I have completed the refactoring of
Neo.tree.Listto improve performance and sticky header behavior.Key Changes:
- Rendering Optimization: Switched from CSS-based hiding (
display: none) to VDOM-based removal (removeDom: true) for collapsed branches. This significantly reduces the size of the live DOM for large trees.- Sticky Header Fixes:
- Disabled sticky positioning for collapsed folders. They now scroll away naturally, preventing the "stacking" of closed headers at the top of the list.
- Corrected the scroll tracking logic (
onScrollCapture) to account for the actual item height (51px vs 48px) and to skip removed DOM nodes. This fixes the drift where headers would get the.neo-stuckclass too early or too late.- Refined
.neo-stuckapplication: Only the last stuck item for a given level gets the class, ensuring that only the visible header (the one on top) receives the background styling.- Layering Improvements:
- Implemented unconditional Z-Index logic (
10000 + level) to ensuring deeper headers (e.g., Level 1) correctly overlay parent headers (Level 0).- Dynamic Updates:
- Updated
onItemClickto dynamically toggleposition: stickyandtopstyles when a folder is expanded or collapsed, ensuring the behavior stays consistent without requiring a full re-render.These changes solve the "All Folders Open" visual bug, the "Stacking Closed Headers" issue, and the "Incorrect/Multiple Stuck Headers" visual glitch.
tobiu assigned to @tobiu on Jan 12, 2026, 7:02 AM
tobiu closed this issue on Jan 12, 2026, 7:03 AM
Current implementation of
Neo.tree.Listrenders all nodes in the DOM and hides collapsed branches using CSSdisplay: none. This causes performance issues with large trees.Refactor to use the
removeDomVDOM property to physically remove collapsed branches from the DOM.Changes:
createItemLevelinsrc/tree/List.mjsto setremoveDom: truefor hidden branches instead ofstyle.display: 'none'.onItemClicklogic to toggle theremoveDomproperty of the childulcontainer instead of relying on CSS cascade.expandAllandcollapseAllto handle theremoveDomproperty.display: none/display: blockrules fromresources/scss/src/tree/List.scss.This will ensure that collapsed nodes are not present in the DOM, improving rendering performance for large datasets.