LearnNewsExamplesServices
Frontmatter
id8911
titleEnable Mouse Drag Scrolling in Grid ScrollManager
stateClosed
labels
aifeature
assigneestobiu
createdAtJan 30, 2026, 11:49 AM
updatedAtJan 30, 2026, 12:33 PM
githubUrlhttps://github.com/neomjs/neo/issues/8911
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 30, 2026, 12:32 PM

Enable Mouse Drag Scrolling in Grid ScrollManager

Closed v11.24.0 aifeature
tobiu
tobiu commented on Jan 30, 2026, 11:49 AM

Enhance Neo.grid.ScrollManager to support mouse-based drag-to-scroll on desktop, improving DX for users without horizontal scroll wheels.

Requirements:

  1. Add mousedown, mousemove, mouseup, and mouseleave listeners to gridBody.
  2. Implement onMouseDown, onMouseMove, onMouseUp, onMouseLeave handlers in ScrollManager.
  3. Calculate deltaX and deltaY from mouse movements and apply them via DomAccess.scrollTo, mirroring the existing touch logic.
  4. Add mouseDragScroll_ config (default: true) to toggle this feature.
  5. Ensure native text selection is prevented during drag (preventDefault) to give a "Hand Tool" feel.
  6. Important: mousemove listener must be registered with local: true to avoid flooding the worker bridge.

Architecture: This implementation remains isolated within ScrollManager and does not require enabling the global Touch sensor on desktop, avoiding conflicts with the main DragDrop system.

tobiu added the ai label on Jan 30, 2026, 11:49 AM
tobiu added the feature label on Jan 30, 2026, 11:49 AM
tobiu assigned to @tobiu on Jan 30, 2026, 12:31 PM
tobiu closed this issue on Jan 30, 2026, 12:32 PM
tobiu referenced in commit 47894ff - "feat: Enable Mouse Drag Scrolling in Grid ScrollManager (#8911)" on Jan 30, 2026, 12:32 PM
tobiu
tobiu Jan 30, 2026, 12:33 PM

Input from Gemini 3 Pro:

✦ I have implemented the mouse drag scrolling enhancements in src/grid/ScrollManager.mjs.

Changes:

  1. Mouse Listener Support: Added mousedown, mousemove (local), mouseup, and mouseleave listeners to gridBody in construct.
  2. Unified Delta Logic: Implemented onMouseDown, onMouseMove, onMouseUp, onMouseLeave to handle drag-to-scroll logic, mirroring the touch implementation but isolated for mouse events.
  3. Config: Added mouseDragScroll_ (default true) to toggle the feature.
    • Added afterSetMouseDragScroll to toggle the neo-mouse-drag-scroll class on the body.
    • Updated resources/scss/src/grid/Body.scss to disable user-select when this class is present.
  4. Touch Conflict Resolution: Added logic in construct to automatically set mouseDragScroll = false if Neo.config.hasTouchEvents is detected, preventing conflicts on hybrid devices.
  5. State: Added isMouseDragging, lastMouseX, lastMouseY to track drag state.

This implementation allows users to scroll the grid by dragging with the mouse, improving DX for users without horizontal scrolling hardware.

Closing the ticket.