Frontmatter
| id | 8960 |
| title | Fix: Vertical scrolling causes OffscreenCanvas loss in Grid cells |
| state | Closed |
| labels | bugai |
| assignees | tobiu |
| createdAt | Feb 3, 2026, 1:36 PM |
| updatedAt | Feb 3, 2026, 1:43 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8960 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | 8930 |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Feb 3, 2026, 1:43 PM |
Fix: Vertical scrolling causes OffscreenCanvas loss in Grid cells

Input from Gemini 3 Pro:
✦ I have implemented the fix for the vertical scrolling glitch where OffscreenCanvas instances were being lost.
Root Cause: The
mountedRowslogic insrc/grid/Body.mjswas calculating the render window based strictly onvisible + buffer. At the boundaries of the dataset (top and bottom), this window size was smaller than theRecycle Modulus(available rows + 2 * buffer). Because the number of rendered rows fluctuated (e.g., shrinking to 15 at the top vs 20 in the middle), the VDOM engine interpreted the re-appearance of the "spare" rows as new insertions (insertNode), which destroys the DOM node and the associated Worker connection.Fix Implemented: Modified
updateMountedAndVisibleRowsto enforce a Constant Window Size equal to the Recycle Modulus.
- At the top of the grid, the window is "pushed down" to include look-ahead rows, filling the recycle pool.
- At the bottom, the window is "pulled up" to include look-behind rows.
Outcome: The set of Row IDs
{row-0 ... row-N}now remains constant as long as the dataset is large enough. This ensures the VDOM engine always generatesmoveNodeoperations for row recycling, preserving theOffscreenCanvascontexts and eliminating the visual glitch during vertical scrolling.
We are observing a glitch where vertically scrolling the grid can cause some OffscreenCanvas instances (like Sparklines) to be "lost" or appear blank.
Analysis: This likely relates to the buffered row range mechanism in
Neo.grid.Body. When rows are recycled or moved, the VDOM diffing engine might be generatingmoveoperations or destructive updates that interfere with theOffscreenCanvaspersistence, similar to the horizontal scrolling issue but on the vertical axis.Investigation Plan:
src/grid/Body.mjsand its row recycling/buffering logic.canvaselements within the recycled rows maintain their worker association.Goal: Ensure
OffscreenCanvasinstances remain stable and connected to their workers during vertical scrolling and row recycling.