feat: kanban use rectIntersection collision detection

This commit is contained in:
chenos 2021-08-24 15:02:46 +08:00
parent 73c52b7ea4
commit 7733e4d5fa

View File

@ -5,6 +5,7 @@ import {
useDroppable, useDroppable,
useSensor, useSensor,
useSensors, useSensors,
rectIntersection,
} from '@dnd-kit/core'; } from '@dnd-kit/core';
import { import {
SortableContext, SortableContext,
@ -218,6 +219,7 @@ const InternalKanban = observer((props: any) => {
<DndContext <DndContext
autoScroll autoScroll
sensors={sensors} sensors={sensors}
collisionDetection={rectIntersection}
onDragStart={(event) => { onDragStart={(event) => {
const el = event?.active?.data?.current?.nodeRef const el = event?.active?.data?.current?.nodeRef
?.current as HTMLElement; ?.current as HTMLElement;