LearnNewsExamplesServices
Frontmatter
id9608
titleFix Event Resolution and Parent Hierarchy Regressions in Nested Sub-Grids
stateClosed
labels
bugaigrid
assigneestobiu
createdAtMar 31, 2026, 12:43 PM
updatedAtMar 31, 2026, 12:47 PM
githubUrlhttps://github.com/neomjs/neo/issues/9608
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMar 31, 2026, 12:47 PM

Fix Event Resolution and Parent Hierarchy Regressions in Nested Sub-Grids

Closedbugaigrid
tobiu
tobiu commented on Mar 31, 2026, 12:43 PM

When transitioning to the Multi-Body grid architecture, explicit parentId injections were removed from GridContainer.beforeSetBody and GridContainer.beforeSetHeaderToolbar to prevent parentage collisions against the newly introduced wrapper elements (bodyWrapper, headerWrapper).

However, this change prevents sub-components from correctly resolving their logical ancestors during early initialization (e.g., inside processConfigs), causing two specific regressions:

  1. TypeError: Cannot read properties of undefined (reading 'apply'): Event bindings mapped via strings (e.g., listeners: { isScrollingChange: 'onGridIsScrollingChange' }) fail to resolve because getController() relies on traversing this.parent upwards. During early instantiation, this.parent is null, causing cb.fn to become undefined and throwing an exception upon event firing.

  2. TypeError: Cannot read properties of null (reading 'id'): Inside src/grid/header/Toolbar.mjs, createSortZone unconditionally attempts to read me.parent.id for its boundaryContainerId mapping.

To resolve this, we will introduce resilient fallback routines by explicitly overriding getController() in Body.mjs and Toolbar.mjs to traverse this.gridContainer when this.parent is functionally unavailable, avoiding hard coupling to structural DOM relationships that are still parsing.

tobiu added the bug label on Mar 31, 2026, 12:43 PM
tobiu added the ai label on Mar 31, 2026, 12:43 PM
tobiu added the grid label on Mar 31, 2026, 12:43 PM
tobiu referenced in commit 5890988 - "fix: Restore native parentage resolution and prevent item null crashes (#9608)" on Mar 31, 2026, 12:46 PM
tobiu
tobiu Mar 31, 2026, 12:47 PM

Input from Gemini 3.1 Pro (Antigravity):

✦ Resolved. The parent hierarchy now correctly maintains linkage natively because me.items is instantiated prior to the wrapper container snatching ownership of the child components. This correctly satisfies the Container.remove algorithm, allowing it to gracefully iterate empty items instead of crashing on a null iteration. Controller lookups correctly climb the object graph dynamically.

tobiu assigned to @tobiu on Mar 31, 2026, 12:47 PM
tobiu closed this issue on Mar 31, 2026, 12:47 PM