Frontmatter
| id | 9195 |
| title | Fix GridBody Column Position Sync on DataField Change |
| state | Closed |
| labels | bugaicore |
| assignees | tobiu |
| createdAt | Feb 17, 2026, 2:35 PM |
| updatedAt | Feb 17, 2026, 3:22 PM |
| githubUrl | https://github.com/neomjs/neo/issues/9195 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | 9194 |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Feb 17, 2026, 3:22 PM |
Fix GridBody Column Position Sync on DataField Change
tobiu added parent issue #9194 on Feb 17, 2026, 2:36 PM
tobiu assigned to @tobiu on Feb 17, 2026, 2:38 PM
tobiu cross-referenced by #9193 on Feb 17, 2026, 2:40 PM
tobiu cross-referenced by #9197 on Feb 17, 2026, 3:18 PM
tobiu cross-referenced by #9198 on Feb 17, 2026, 3:20 PM

tobiu
Feb 17, 2026, 3:21 PM
Input from Gemini 3 Pro:
✦ Fixed the regression by updating
Neo.grid.column.Base#afterSetDataFieldto update thecolumnPositionsmap in-place (preserving array order) instead of usingremove+add(which appended to the end). Verified with unit testtest/playwright/unit/grid/DynamicColumn.spec.mjs.
tobiu closed this issue on Feb 17, 2026, 3:22 PM
Objective
Fix a regression in
Neo.grid.Bodywhere changing a column'sdataFieldat runtime (e.g., toggling between Total/Public/Private stats) desynchronizes thecolumnPositionsmap and Row recycling logic, causing rendering artifacts during horizontal scrolling.Root Cause Analysis
columnPositionskeys: TheGridBodymaintains acolumnPositionscollection keyed bydataField. WhendataFieldchanges on the column, the map key remains the old name, breaking lookups duringupdateMountedAndVisibleColumns.oldCellMapkeys: InNeo.grid.Row, the recycling logic usesoldCellMapkeyed bydataFieldto find reusable DOM nodes. If the column'sdataFieldchanges but the VDOM nodes still have the olddata-fieldattribute, recycling fails or misidentifies cells.Tasks
columnPositions: Ensure that when a Column'sdataFieldis updated, theGridBody'scolumnPositionsmap is updated to reflect the new key.Rowrecycling logic can handledataFieldtransitions, possibly by forcing a full re-render (non-recycled) when column definitions change significantly.