LearnNewsExamplesServices
Frontmatter
id9015
titleFix Regression in Cell Selection Model Cycling (Crash in updateRows)
stateClosed
labels
bugairegression
assigneestobiu
createdAtFeb 6, 2026, 5:52 PM
updatedAtFeb 6, 2026, 5:58 PM
githubUrlhttps://github.com/neomjs/neo/issues/9015
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtFeb 6, 2026, 5:58 PM

Fix Regression in Cell Selection Model Cycling (Crash in updateRows)

Closed v12.0.0 bugairegression
tobiu
tobiu commented on Feb 6, 2026, 5:52 PM

Cycling through cells (e.g., arrow left on first column to last) causes a crash in BaseModel.updateRows. The error TypeError: Cannot read properties of undefined (reading 'cls') occurs because cellNode can be undefined if the target cell is not currently rendered (unmounted), but the code attempts to access cellNode.cls to determine alreadySelect state before checking if cellNode exists.

Stack Trace:

BaseModel.mjs:72 Uncaught TypeError: Cannot read properties of undefined (reading 'cls')
    at BaseModel.mjs:72:54
    at Array.forEach (<anonymous>)
    at CellModel.updateRows (BaseModel.mjs:54:15)

Proposed Fix:

  1. Safe access cellNode?.cls in BaseModel.mjs.
  2. Ensure aria-selected is applied to cells in src/grid/Row.mjs to ensure unmounted cells get correct attributes when they are eventually rendered.
tobiu added the bug label on Feb 6, 2026, 5:52 PM
tobiu added the ai label on Feb 6, 2026, 5:52 PM
tobiu added the regression label on Feb 6, 2026, 5:52 PM
tobiu referenced in commit 1a2d910 - "bugfix: Fix regression in Cell Selection Model Cycling (Crash in updateRows) (#9015)" on Feb 6, 2026, 5:57 PM
tobiu assigned to @tobiu on Feb 6, 2026, 5:57 PM
tobiu
tobiu Feb 6, 2026, 5:58 PM

Input from Gemini 3 Pro:

✦ I have resolved the regression causing the crash during cell cycling and added aria-selected support for cell models.

Fixes Implemented:

  1. Crash Fix in BaseModel.updateRows:

    • The code now safely checks cellNode?.cls before attempting to read includes.
    • This prevents the TypeError when cycling causes the selection of an unmounted cell (e.g., during a scroll jump).
  2. aria-selected for Cells:

    • In BaseModel: Added logic to toggle the aria-selected attribute on the cell node during granular updates (updateRows), matching the behavior for rows.
    • In Row.mjs: Updated applyRendererOutput to strictly check selectedCells.includes(logicalCellId) and apply both the neo-selected class AND aria-selected=true.
    • Optimization: In Row.mjs, combined the selection check to occur after cellConfig creation, modifying the cls array in-place and setting the attribute in one block. This avoids duplicating the includes check.

The cell selection model should now cycle correctly without errors and properly report accessibility state.

tobiu closed this issue on Feb 6, 2026, 5:58 PM