Skip to content

Commit aeee2ec

Browse files
msujawsclaude
andcommitted
fix(dnd): use pointerWithin collision detection for cross-container drag
Change from closestCenter to pointerWithin collision detection algorithm. closestCenter calculates distance from item center to droppable centers, which doesn't work well when the backlog is below the board - dragging from backlog to columns often registered the wrong target. pointerWithin uses cursor position to determine the drop target, which is more intuitive for vertically stacked containers. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent ce3807a commit aeee2ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/Board/Board.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useMemo, useState, useEffect, useCallback } from 'react'
22
import {
33
DndContext,
44
DragOverlay,
5-
closestCenter,
5+
pointerWithin,
66
PointerSensor,
77
useSensor,
88
useSensors,
@@ -500,7 +500,7 @@ export function Board({
500500
return (
501501
<DndContext
502502
sensors={sensors}
503-
collisionDetection={closestCenter}
503+
collisionDetection={pointerWithin}
504504
onDragStart={handleDragStart}
505505
onDragEnd={handleDragEnd}
506506
>

0 commit comments

Comments
 (0)