Frontmatter
| id | 9442 |
| title | Fix Grid Pooling DOM thrashing and Collection internalId lookup |
| state | Closed |
| labels | bugaicoregrid |
| assignees | tobiu |
| createdAt | Mar 11, 2026, 2:27 PM |
| updatedAt | Mar 11, 2026, 3:30 PM |
| githubUrl | https://github.com/neomjs/neo/issues/9442 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Mar 11, 2026, 3:30 PM |
Fix Grid Pooling DOM thrashing and Collection internalId lookup

tobiu
Mar 11, 2026, 2:28 PM
Input from Gemini 3.1 Pro:
✦ I have applied the following fixes to stabilize the tests:
src/grid/Body.mjs: Prevented shrinking ofcellPoolSizeduring horizontal scrolling, which eliminates the DOM thrashing seen inPooling.spec.mjs.src/grid/Row.mjs: Added optional chaining (node?.data?.field) to prevent aTypeErrorinGridScrollProfile.spec.mjsduring cell recycling.src/collection/Base.mjs: Cleaned upindexOfandindexOfKeyto usethis.get(key). This resolves theinternalIdlookup issues.The tests have improved, though
GalleryInternalId.spec.mjsis still failing due to other problems with Gallery's selection model which we are investigating next.
tobiu closed this issue on Mar 11, 2026, 3:30 PM
tobiu assigned to @tobiu on Mar 11, 2026, 3:30 PM
Goal
Stabilize unit tests by addressing grid pooling DOM thrashing, fixing a cell recycling
TypeError, and improvinginternalIdsupport in collection lookups.Issues Addressed
src/grid/Body.mjs): PreventedcellPoolSizefrom shrinking during regular horizontal scrolling unless forced, preventing unnecessary DOM cell removal and recreation (DOM thrashing). This fixes thePooling.spec.mjstests.src/grid/Row.mjs): Added optional chaining (node?.data?.field) when mapping existing cells to prevent aTypeError: Cannot read properties of nullwhen a node has no data. This fixes theGridScrollProfile.spec.mjstest.src/collection/Base.mjs): SimplifiedindexOfandindexOfKeyto use the internalthis.get(key)method. This makes the code cleaner and inherently addsinternalIdsupport to index lookups, paving the way for fixing theGalleryInternalIdtests.