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:
- Registration:
DomEvent.register was storing listeners under the physical wrapper ID (e.g., #neo-grid-body-1__wrapper).
- 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.
Problem
DOM events on components with wrapper nodes (e.g.,
Grid.Bodywrapped in a div) were failing to trigger listeners.The root cause was a mismatch between storage and lookup:
DomEvent.registerwas storing listeners under the physical wrapper ID (e.g.,#neo-grid-body-1__wrapper).DomEvent.firecalculates the bubbling path usingComponent.getParentPath, which returns a logical component tree (e.g.,['neo-grid-body-1', 'neo-grid-container-1', ...]).Because
firelooks up listeners using the logical component ID, it never found the listeners registered under the wrapper ID.Solution
Updated
Neo.manager.DomEvent#registerto prioritize the Logical Component ID (ownerId) for storage.config.ownerIdis present, it is used as the key in theitemsmap, replacing the physical node ID.listenerConfig.vnodeIdto ensureverifyDelegationPathcontinues to work correctly for event delegation.fire, which walks the logical component tree, correctly finds listeners even if they are physically attached to a wrapper node.Changes
src/manager/DomEvent.mjsregister()to resolve the storage ID at the start of the method.