fix(accounts): drop long-press drag so mobile can scroll

The touch long-press sensor was capturing the gesture and blocking
page scroll on mobile. Remove it and drive touch drag through the
pointer sensor instead: grabbing the handle (the account type icon)
starts the drag, the rest of the card scrolls. The subtle 'selection'
haptic on drag start is kept.
This commit is contained in:
Víctor Falcón 2026-06-21 10:58:48 +02:00
parent ac8ac276ae
commit 95f05ea463
1 changed files with 3 additions and 6 deletions

View File

@ -6,7 +6,6 @@ import {
type DragEndEvent,
KeyboardSensor,
PointerSensor,
TouchSensor,
closestCenter,
useSensor,
useSensors,
@ -48,13 +47,11 @@ export function SortableGrid<T>({
const ids = items.map(getId);
const { trigger } = useWebHaptics();
// Pointer drag starts after a small move (so clicks still work); touch drag
// starts on a long press, leaving quick swipes free to scroll the page.
// A small move starts the drag, so taps/clicks still work. Touch is handled
// via pointer events and only the handle has touch-action: none, so the rest
// of the card scrolls normally on mobile (no long-press, which blocked it).
const sensors = useSensors(
useSensor(PointerSensor, { activationConstraint: { distance: 8 } }),
useSensor(TouchSensor, {
activationConstraint: { delay: 200, tolerance: 8 },
}),
useSensor(KeyboardSensor, {
coordinateGetter: sortableKeyboardCoordinates,
}),