LearnNewsExamplesServices
Frontmatter
id9195
titleFix GridBody Column Position Sync on DataField Change
stateClosed
labels
bugaicore
assigneestobiu
createdAtFeb 17, 2026, 2:35 PM
updatedAtFeb 17, 2026, 3:22 PM
githubUrlhttps://github.com/neomjs/neo/issues/9195
authortobiu
commentsCount1
parentIssue9194
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtFeb 17, 2026, 3:22 PM

Fix GridBody Column Position Sync on DataField Change

Closed v12.0.0 bugaicore
tobiu
tobiu commented on Feb 17, 2026, 2:35 PM

Objective

Fix a regression in Neo.grid.Body where changing a column's dataField at runtime (e.g., toggling between Total/Public/Private stats) desynchronizes the columnPositions map and Row recycling logic, causing rendering artifacts during horizontal scrolling.

Root Cause Analysis

  1. Stale columnPositions keys: The GridBody maintains a columnPositions collection keyed by dataField. When dataField changes on the column, the map key remains the old name, breaking lookups during updateMountedAndVisibleColumns.
  2. Stale oldCellMap keys: In Neo.grid.Row, the recycling logic uses oldCellMap keyed by dataField to find reusable DOM nodes. If the column's dataField changes but the VDOM nodes still have the old data-field attribute, recycling fails or misidentifies cells.

Tasks

  1. Sync columnPositions: Ensure that when a Column's dataField is updated, the GridBody's columnPositions map is updated to reflect the new key.
  2. Robust Recycling: Verify Row recycling logic can handle dataField transitions, possibly by forcing a full re-render (non-recycled) when column definitions change significantly.
  3. Verification: Verify that horizontal scrolling works seamlessly after a Data Mode switch in DevIndex.
tobiu added the bug label on Feb 17, 2026, 2:36 PM
tobiu added the ai label on Feb 17, 2026, 2:36 PM
tobiu added the core label on Feb 17, 2026, 2:36 PM
tobiu added parent issue #9194 on Feb 17, 2026, 2:36 PM
tobiu referenced in commit b3c9b2c - "feat(core): Implement virtual fields and fix grid data mode switching (#9193, #9195)" on Feb 17, 2026, 2:37 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
tobiu Feb 17, 2026, 3:21 PM

Input from Gemini 3 Pro:

✦ Fixed the regression by updating Neo.grid.column.Base#afterSetDataField to update the columnPositions map in-place (preserving array order) instead of using remove + add (which appended to the end). Verified with unit test test/playwright/unit/grid/DynamicColumn.spec.mjs.

tobiu closed this issue on Feb 17, 2026, 3:22 PM
tobiu referenced in commit faeb66f - "fix(grid): Preserve columnPositions order when updating dataField (#9195)" on Feb 17, 2026, 3:22 PM