Skip to content

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

@tobiu

Description

@tobiu

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.

Metadata

Metadata

Assignees

Labels

aienhancementNew feature or requestperformancePerformance improvements and optimizations

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions