LearnNewsExamplesServices
Frontmatter
id9531
titleGrid SortZone incorrectly intercepts column resize drag events, causing VDOM corruption and layout thrash
stateClosed
labels
bugaigrid
assigneestobiu
createdAtMar 20, 2026, 10:46 PM
updatedAtMar 20, 2026, 10:48 PM
githubUrlhttps://github.com/neomjs/neo/issues/9531
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMar 20, 2026, 10:48 PM

Grid SortZone incorrectly intercepts column resize drag events, causing VDOM corruption and layout thrash

Closed v12.1.0 bugaigrid
tobiu
tobiu commented on Mar 20, 2026, 10:46 PM

Description

When resizing a grid column (using grid.header.plugin.Resizable), the draggable.grid.header.toolbar.SortZone was concurrently intercepting the same drag:start, drag:move, and drag:end events because both plugins listen to the same header button DOM nodes.

This caused the SortZone to execute its column-reordering logic during a resize operation. Specifically, SortZone.onDragStart would falsely identify a column as being dragged and set its columnPosition.hidden = true and cell.style.visibility = 'hidden'. This led to grid cells vanishing during resize. Furthermore, SortZone.onDragEnd would needlessly trigger grid.body.createViewData(false, true), causing massive performance degradation by forcing a full, un-recycled VDOM regeneration of the entire grid body on every resize.

Solution

  1. Mutex via Config: Repurposed the dragResortable config on the header toolbar as a runtime semaphore.
  2. Resizable Plugin: Modified grid.header.plugin.Resizable to set toolbar.dragResortable = false on drag:start and restore it to true on drag:end. Also optimized the toolbar lookup from owner.up() to owner.parent.
  3. SortZone Bailouts: Added strict if (!me.owner.dragResortable) return; bailouts to the very top of onDragStart, onDragMove, and onDragEnd in draggable.grid.header.toolbar.SortZone. This cleanly severs the event processing if a resize is active.
  4. Cleanup: Removed the now-obsolete delete cell.style.visibility; "self-healing" hack from grid.Body#updateCellPositions since the underlying VDOM corruption is prevented entirely.
tobiu added the bug label on Mar 20, 2026, 10:47 PM
tobiu added the ai label on Mar 20, 2026, 10:47 PM
tobiu added the grid label on Mar 20, 2026, 10:47 PM
tobiu referenced in commit 2ed06e8 - "fix: Prevent SortZone from intercepting column resize drag events (#9531) on Mar 20, 2026, 10:47 PM
tobiu assigned to @tobiu on Mar 20, 2026, 10:47 PM
tobiu
tobiu Mar 20, 2026, 10:48 PM

Fixed in 2ed06e864

tobiu closed this issue on Mar 20, 2026, 10:48 PM
tobiu referenced in commit 5a539f4 - "fix: Add timeout to dragResortable restoration to prevent trailing event race conditions (#9531)" on Mar 20, 2026, 10:52 PM