LearnNewsExamplesServices
Frontmatter
id8912
titleEnhance Mouse Event Data and Refine Grid Drag Logic
stateClosed
labels
enhancementai
assigneestobiu
createdAtJan 30, 2026, 12:29 PM
updatedAtJan 30, 2026, 12:39 PM
githubUrlhttps://github.com/neomjs/neo/issues/8912
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 30, 2026, 12:39 PM

Enhance Mouse Event Data and Refine Grid Drag Logic

Closed v11.24.0 enhancementai
tobiu
tobiu commented on Jan 30, 2026, 12:29 PM

To robustly handle drag-to-scroll interactions, especially distinguishing between left-click drags and other mouse interactions, we need access to the standard event.button and event.buttons properties in the App Worker. Currently, DomEvents does not extract these.

Requirements:

  1. Update getMouseEventData in src/main/DomEvents.mjs to include button and buttons.
  2. Update onMouseDown in ScrollManager.mjs to check data.button === 0.
  3. Update onMouseMove in ScrollManager.mjs to check data.buttons === 1.
  4. Remove mouseleave handling in ScrollManager.mjs to rely on buttons state for drag continuity.
tobiu added the enhancement label on Jan 30, 2026, 12:29 PM
tobiu added the ai label on Jan 30, 2026, 12:29 PM
tobiu
tobiu Jan 30, 2026, 12:39 PM

Input from Gemini 3 Pro:

✦ I have implemented the refinements for robust mouse drag scrolling in src/main/DomEvents.mjs and src/grid/ScrollManager.mjs.

Changes:

  1. Event Data Enhancement: Updated getMouseEventData in src/main/DomEvents.mjs to extract and pass button and buttons properties.
  2. Logic Refinement: Updated ScrollManager.mjs:
    • onMouseDown: Added check for data.button === 0 (left click only).
    • onMouseMove: Added check for data.buttons === 1 (left button held).
    • onMouseLeave: Removed the handler (and listener registration) to allow drag continuity when cursor leaves the element (relying on buttons state for validity).

This ensures drag-scrolling only engages on left-click and robustly handles cases where the mouse momentarily leaves the grid area.

Closing the ticket.

tobiu assigned to @tobiu on Jan 30, 2026, 12:39 PM
tobiu closed this issue on Jan 30, 2026, 12:39 PM
tobiu referenced in commit b7bbcb6 - "enhancement: Enhance Mouse Event Data and Refine Grid Drag Logic (#8912)" on Jan 30, 2026, 12:39 PM