LearnNewsExamplesServices
Frontmatter
id8088
titleFix DOM event mapping for components with wrapper nodes
stateClosed
labels
bugai
assigneestobiu
createdAtDec 11, 2025, 2:37 PM
updatedAtDec 11, 2025, 2:39 PM
githubUrlhttps://github.com/neomjs/neo/issues/8088
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtDec 11, 2025, 2:39 PM

Fix DOM event mapping for components with wrapper nodes

Closed v11.17.0 bugai
tobiu
tobiu commented on Dec 11, 2025, 2:37 PM

Problem

DOM events on components with wrapper nodes (e.g., Grid.Body wrapped in a div) were failing to trigger listeners.

The root cause was a mismatch between storage and lookup:

  1. Registration: DomEvent.register was storing listeners under the physical wrapper ID (e.g., #neo-grid-body-1__wrapper).
  2. Firing: DomEvent.fire calculates the bubbling path using Component.getParentPath, which returns a logical component tree (e.g., ['neo-grid-body-1', 'neo-grid-container-1', ...]).

Because fire looks up listeners using the logical component ID, it never found the listeners registered under the wrapper ID.

Solution

Updated Neo.manager.DomEvent#register to prioritize the Logical Component ID (ownerId) for storage.

  • When registering a listener, if config.ownerId is present, it is used as the key in the items map, replacing the physical node ID.
  • The physical node ID is still preserved in listenerConfig.vnodeId to ensure verifyDelegationPath continues to work correctly for event delegation.
  • This ensures that fire, which walks the logical component tree, correctly finds listeners even if they are physically attached to a wrapper node.

Changes

  • Refactored src/manager/DomEvent.mjs register() to resolve the storage ID at the start of the method.
tobiu added the bug label on Dec 11, 2025, 2:37 PM
tobiu added the ai label on Dec 11, 2025, 2:37 PM
tobiu assigned to @tobiu on Dec 11, 2025, 2:38 PM
tobiu referenced in commit bce961a - "Fix DOM event mapping for components with wrapper nodes #8088" on Dec 11, 2025, 2:38 PM
tobiu closed this issue on Dec 11, 2025, 2:39 PM
tobiu cross-referenced by #8089 on Dec 11, 2025, 3:23 PM