LearnNewsExamplesServices
Frontmatter
id8987
titleenhancement: GridDragScroll: Add delay and minDistance to prevent accidental drags
stateClosed
labels
enhancementaiperformance
assigneestobiu
createdAtFeb 4, 2026, 5:05 PM
updatedAtFeb 5, 2026, 10:05 AM
githubUrlhttps://github.com/neomjs/neo/issues/8987
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtFeb 5, 2026, 10:05 AM

enhancement: GridDragScroll: Add delay and minDistance to prevent accidental drags

Closed v12.0.0 enhancementaiperformance
tobiu
tobiu commented on Feb 4, 2026, 5:05 PM

Context

Currently, Neo.main.addon.GridDragScroll initiates a drag operation immediately upon a mousedown or touchstart event. This converts the cursor to grabbing instantly, which can feel aggressive and lead to accidental scroll starts when the user merely intended to click or select.

Objective

Adopt the delay and minDistance pattern found in Neo.main.draggable.sensor.Mouse to ensure drag operations are intentional.

Requirements

  1. Add Configs:
    • delay: Default to 100 (ms).
    • minDistance: Default to 5 (px).
  2. State Tracking:
    • Track mouseDownTime.
    • Track start coordinates.
    • Track mouseDownTimeout.
  3. Logic Update:
    • onDragStart should not immediately set activeDrag or change the cursor.
    • Instead, it should start monitoring mousemove/touchmove.
    • The drag (and cursor change) should only activate once both conditions are met (following the Mouse.mjs pattern):
      • timeElapsed >= delay
      • distanceTravelled >= minDistance

Goal

Improve the "feel" of grid interactions by preventing accidental drags during normal click operations.

tobiu added the enhancement label on Feb 4, 2026, 5:05 PM
tobiu added the ai label on Feb 4, 2026, 5:05 PM
tobiu added the performance label on Feb 4, 2026, 5:05 PM
tobiu referenced in commit c66635e - "enhancement: GridDragScroll: Add delay and minDistance to prevent accidental drags (#8987)" on Feb 4, 2026, 5:12 PM
tobiu assigned to @tobiu on Feb 4, 2026, 5:12 PM
tobiu
tobiu Feb 4, 2026, 5:13 PM

Input from Gemini 3 Pro:

✦ Implemented delay (100ms) and minDistance (5px) checks in GridDragScroll.

  • Added construct to bind handlers.
  • Refactored onDragStart to initiate a monitoring phase.
  • Added onMonitorMove to check both time and distance criteria before transitioning to active drag.
  • This ensures drag operations are intentional and prevents accidental cursor changes on simple clicks.
tobiu closed this issue on Feb 5, 2026, 10:05 AM