Skip to content

fix(board): slow the edge auto-scroll while dragging a card on mobile#47

Merged
bryankennedy merged 1 commit into
mainfrom
fix/board-autoscroll-speed
Jun 30, 2026
Merged

fix(board): slow the edge auto-scroll while dragging a card on mobile#47
bryankennedy merged 1 commit into
mainfrom
fix/board-autoscroll-speed

Conversation

@exe-dev-github-integration

@exe-dev-github-integration exe-dev-github-integration Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Follow-up to the board mobile-drag work (#46). Now that dragging a card works on touch, holding it at the board's left/right edge to reach another column auto-scrolls far too fast to land in the column you want — on a phone only ~one column is visible at a time, so it overshoots constantly.

Cause

dnd-kit's edge auto-scroll runs scrollBy(acceleration) every interval (5ms). At the default acceleration: 10 that's ~2000 px/s.

Fix

autoScroll={{ acceleration: 2 }} on DndContext — caps the edge-scroll at ~320 px/s (≈ one column per second) while keeping the smooth 5 ms cadence. Lowering acceleration caps speed without the choppiness that raising interval would add; it's the single knob to dial.

Verification

  • tsc -b clean; bun run test → 84 pass.
  • Sampled scrollLeft over an edge-hold with real touch events (CDP, 390px): measured ~340 px/s (default was ~2000; an earlier acceleration-5 pass measured ~800 and still felt too fast). Tap-to-open and within-column reorder unaffected.

With a card held at the board's left/right edge, dnd-kit's default auto-scroll
(acceleration 10) pans the column strip at ~2000px/s — far too fast to land in
the intended column on a phone, where only ~one column is visible at a time, so
moving a card across columns overshoots constantly.

Pass autoScroll={{ acceleration: 5 }} to DndContext to halve the top edge-scroll
speed (~800px/s measured) while keeping the smooth 5ms scroll cadence — lowering
acceleration caps speed without the choppiness that raising `interval` would add.
acceleration is the single knob to dial further if it's still fast.
@bryankennedy bryankennedy merged commit 71d83a1 into main Jun 30, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant