LearnNewsExamplesServices
Frontmatter
id9530
titleGrid cells vanish during column resize after a drag-and-drop column reorder
stateClosed
labels
bugaigrid
assigneestobiu
createdAtMar 20, 2026, 9:07 PM
updatedAtMar 20, 2026, 9:18 PM
githubUrlhttps://github.com/neomjs/neo/issues/9530
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMar 20, 2026, 9:16 PM

Grid cells vanish during column resize after a drag-and-drop column reorder

Closed v12.1.0 bugaigrid
tobiu
tobiu commented on Mar 20, 2026, 9:07 PM

Description

We encountered a glitch where grid cells can vanish during a column resize operation if the grid columns were previously reordered via drag-and-drop. This occurs regardless of how much time passes between the reorder and the resize.

Reproduction

  1. Enable SortZone (drag-and-drop reordering) and Resizable on a grid.
  2. Drag and drop column A to a new position.
  3. Grab the resize handle of another column and drag to resize it.
  4. The cells of column A will vanish from the grid body during the drag:move cycle, but reappear when the drag ends.

Root Cause Analysis

During a drag-and-drop column reorder (SortZone.onDragStart), the cells of the dragged column are explicitly hidden (cell.style.visibility = 'hidden'). While the cells correctly reappear in the DOM upon drop, the VDOM state somehow retains or inherits this hidden visibility state in the App Worker. When a subsequent drag:move resize operation triggers updateCellPositions (which performs a shallow updateDepth: 2 sync to the VDOM), the VDOM worker blindly reapplies the stale visibility: 'hidden' state to the previously reordered column.

Solution

Implement a self-healing safety net inside updateCellPositions in src/grid/Body.mjs. If it encounters a cell with style.visibility === 'hidden', it explicitly deletes the visibility property before generating the shallow update delta. Additionally, the updateCellPositions loop was optimized to rely on linear array order rather than spatial math, making the calculation more robust.

tobiu added the bug label on Mar 20, 2026, 9:07 PM
tobiu added the ai label on Mar 20, 2026, 9:07 PM
tobiu added the grid label on Mar 20, 2026, 9:07 PM
tobiu changed title from Grid cells vanish during rapid resize after column sort to Grid cells vanish during column resize after a drag-and-drop column reorder on Mar 20, 2026, 9:14 PM
tobiu referenced in commit 458f91c - "fix: Prevent grid cells vanishing during column resize after drag-and-drop reorder (#9530)" on Mar 20, 2026, 9:15 PM
tobiu assigned to @tobiu on Mar 20, 2026, 9:15 PM
tobiu
tobiu Mar 20, 2026, 9:15 PM

Input from Gemini 3.1 Pro:

✦ The updateCellPositions method in src/grid/Body.mjs was refactored to:

  1. Eliminate spatial (pos.x > minX) logic and instead rely on robust, single-pass iteration using the columnPositions array order, making it immune to absolute viewport coordinate pollution.
  2. Introduce a self-healing block that explicitly deletes style.visibility before applying the delta, ensuring that stale visibility: 'hidden' state left behind by the asynchronous 20ms timeout queue is safely cleared during the drag:move tick.

The update has been pushed to the dev branch. Closing this ticket.

tobiu closed this issue on Mar 20, 2026, 9:16 PM