Frontmatter
| id | 8441 |
| title | Safe check for DragZone handlers in DomEvent manager |
| state | Closed |
| labels | bugai |
| assignees | tobiu |
| createdAt | Jan 8, 2026, 9:38 PM |
| updatedAt | Jan 8, 2026, 9:41 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8441 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jan 8, 2026, 9:41 PM |
Safe check for DragZone handlers in DomEvent manager

tobiu
Jan 8, 2026, 9:40 PM
Input from Gemini 3 Pro:
✦ Applied the fix using optional chaining (
?.) as requested.dragZone[eventName === 'drag:move' ? 'onDragMove' : 'onDragEnd']?.(data)This ensures the method is only called if it exists on the
DragZoneinstance, resolving the crash for baseDragZoneusage (likeSplitter) while maintaining functionality for subclasses likeSortZone.
tobiu assigned to @tobiu on Jan 8, 2026, 9:41 PM
tobiu closed this issue on Jan 8, 2026, 9:41 PM
The
DomEventmanager incorrectly assumes that allDragZoneinstances implementonDragMoveandonDragEndmethods. While subclasses likeNeo.draggable.dashboard.SortZoneimplement these methods, the baseNeo.draggable.DragZonedoes not (it usesdragMoveanddragEnd).This causes a
TypeErrorwhen using components likeNeo.component.Splitterthat use the baseDragZone.Proposed Fix: Update
src/manager/DomEvent.mjsto safely check for the existence ofonDragMoveandonDragEndbefore calling them. Do not add a fallback todragMove/dragEndto avoid unintentional side effects or double-firing of logic, as the event firing mechanism handles the rest.Code Change:
// src/manager/DomEvent.mjs if (eventName.startsWith('drag:')) { const handlerName = eventName === 'drag:move' ? 'onDragMove' : 'onDragEnd'; if (typeof dragZone[handlerName] === 'function') { dragZone[handlerName](data); } }Verification:
Splitterdrag no longer throws errors.Dashboardsorting (which usesSortZone) still works correctly.