You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor of the `CollisionDetection` interface to return an array of `Collision`s:
7
+
8
+
```diff
9
+
+export interface Collision {
10
+
+ id: UniqueIdentifier;
11
+
+ data?: Record<string, any>;
12
+
+}
13
+
14
+
export type CollisionDetection = (args: {
15
+
active: Active;
16
+
collisionRect: ClientRect;
17
+
droppableContainers: DroppableContainer[];
18
+
pointerCoordinates: Coordinates | null;
19
+
-}) => UniqueIdentifier;
20
+
+}) => Collision[];
21
+
```
22
+
23
+
This is a breaking change that requires all collision detection strategies to be updated to return an array of `Collision` rather than a single `UniqueIdentifier`
24
+
25
+
The `over` property remains a single `UniqueIdentifier`, and is set to the first item in returned in the collisions array.
26
+
27
+
Consumers can also access the `collisions` property which can be used to implement use-cases such as combining droppables in user-land.
28
+
29
+
The `onDragMove`, `onDragOver` and `onDragEnd` callbacks are also updated to receive the collisions array property.
30
+
31
+
Built-in collision detections such as rectIntersection, closestCenter, closestCorners and pointerWithin adhere to the CollisionDescriptor interface, which extends the Collision interface:
0 commit comments