Skip to content

fix(board): make mobile card drag usable — iOS callout + edge-scroll speed#46

Merged
bryankennedy merged 1 commit into
mainfrom
fix/board-card-touch-callout
Jun 30, 2026
Merged

fix(board): make mobile card drag usable — iOS callout + edge-scroll speed#46
bryankennedy merged 1 commit into
mainfrom
fix/board-card-touch-callout

Conversation

@exe-dev-github-integration

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

Copy link
Copy Markdown
Contributor

Two related fixes that make dragging a board card actually work on a touchscreen (found while testing on an iPhone after the PROG-79 mobile nav work).

1. iOS link callout hijacked the drag

Board cards are wrapped in a <Link> (an <a>), and iOS Safari fires its native link callout ("Tap to show preview" + Open / Add to Reading List / Copy Link / Share) on long-press — which is the exact press-and-hold gesture the dnd-kit TouchSensor uses to start a drag (D30). So every drag attempt popped the Safari menu instead.

Fix (BoardCard, Home.tsx): -webkit-touch-callout: none on the card wrapper (inherited, so it covers the anchor + contents), plus user-select: none (kills the long-press selection menu) and draggable={false} on the anchor (drops the native drag image). A card is a drag handle / nav target, not selectable copy.

2. Edge auto-scroll was way too fast

Once dragging worked, holding a card at the board's left/right edge to reach another column auto-scrolled at dnd-kit's default acceleration: 102000 px/s — impossible to land in the intended column on a phone (only ~one column is visible).

Fix: autoScroll={{ acceleration: 5 }} on DndContext — halves the top edge-scroll speed (~800 px/s measured) while keeping the smooth 5 ms cadence. acceleration is the single knob to dial lower if it still feels fast.

Verification

  • tsc -b clean; bun run test → 84 pass.
  • Real touch events (CDP) at 390px: tap-to-open still navigates, within-column hold-drag still reorders, cross-column drag works; measured edge auto-scroll dropped from ~2000 to ~800 px/s.
  • ⚠️ -webkit-touch-callout is WebKit/iOS-only, so headless Chromium can't reproduce the callout — the suppression needs an on-device confirm in iOS Safari (the style object is confirmed applied; user-select:none is observable in Chromium).

…o drag

Board cards are wrapped in a <Link> (an <a>). On iOS Safari a long-press on a
link fires the native callout — the "Open / Add to Reading List / Copy Link /
Share" preview menu — and a long-press is exactly the press-and-hold gesture the
TouchSensor uses to begin a drag (D30). So every attempt to drag a card popped
the iOS link menu instead, making drag-to-reorder/-restatus unusable on a phone.

Set `-webkit-touch-callout: none` on the card wrapper (the property is inherited,
so it covers the anchor and its contents) to suppress the callout, plus
`user-select: none` so the long-press doesn't raise the text-selection menu
either, and `draggable={false}` on the anchor to drop its native HTML5 drag
image. A card is a drag handle / navigation target, not selectable copy, so none
of these costs anything. Tap-to-open and the hold-drag reorder are unchanged
(regression-checked); the callout itself is iOS-only and not reproducible in
headless Chromium, so it needs an on-device confirm.
@bryankennedy bryankennedy merged commit 69de81e into main Jun 30, 2026
2 checks passed
@exe-dev-github-integration exe-dev-github-integration Bot changed the title fix(board): suppress iOS link callout on long-press drag of cards fix(board): make mobile card drag usable — iOS callout + edge-scroll speed Jun 30, 2026
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