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
You can customize this behavior with different collision detection algorithms:
69
76
@@ -82,13 +89,13 @@ const droppable = new Droppable({
82
89
}, manager);
83
90
```
84
91
85
-
For example, the `closestCenter` detector will detect collisions based on the distance between the center points:
92
+
For example, the `closestCenter` detector will detect collisions based on the distance between the center points, which is ideal for card stacking:
86
93
87
-
<imgsrc="/images/droppable/closest-center.svg" />
94
+
<img src="/images/droppable/closest-center.svg" alt="Closest center collision detection" />
88
95
89
96
### Collision Priority
90
97
91
-
When multiple droppable targets overlap, you can set priority to determine which one should receive the drop:
98
+
When multiple droppable targets overlap, you can set priority to determine which one should receive the drop. This is particularly useful for nested containers:
92
99
93
100
```js
94
101
constcontainer=newDroppable({
@@ -124,14 +131,14 @@ The `Droppable` class accepts the following arguments:
Priority level when multiple droppable targets overlap. See [collision priority](#collision-priority) for more details.
141
+
Priority level when multiple droppable targets overlap. Higher numbers take precedence. See [collision priority](#collision-priority) for more details.
135
142
</ParamField>
136
143
137
144
<ParamField path="disabled" type="boolean">
@@ -163,4 +170,4 @@ The `Droppable` instance provides these key properties:
163
170
- `refreshShape()`: Recalculate the target's dimensions
164
171
- `register()`: Register this target with the manager
165
172
- `unregister()`: Remove this target from the manager
166
-
-`destroy()`: Clean up this droppable instance
173
+
- `destroy()`: Clean up this droppable instance and remove all listeners
0 commit comments