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
|`areaSelector`| string | null | Selector of the element considered as the "inside" area. |
106
+
|`dragImage`| element or object or string | null | The image used when the element is dragging. |
107
+
|`dragClassName`| string | null | A class name that will be assigned to the dragged element. |
108
+
|`animate`| boolean | false | A flag to enable animation back. |
109
+
|`animateOptions`| object | { duration: .2, timingFunction: 'ease' } | Optional options for the animation back (see [Animation Options](#animation-options)). |
110
+
|`onDropOutside`| function | null | Callback triggered when the dragged element is dropped outside the area. |
111
+
|`onDropInside`| function | null | Callback triggered when the dragged element is dropped inside the area |
112
+
|`onDragCancel`| function | null | Callback triggered when the drag is cancelled (Esc key) |
111
113
112
114
### Area Selector
113
115
@@ -237,13 +239,28 @@ The class declaration will be parsed and set to the `style` attribute of the dra
237
239
</style>
238
240
```
239
241
242
+
### Animation
243
+
244
+
By default, when the dragged element is dropped inside the area or if the drag is cancelled, the dragged element is plainly removed.
245
+
246
+
When setting the `animate` to `true`, when those events happen, the dragged element is smoothly moved back to its original position.
247
+
248
+
#### Animation Options
249
+
250
+
The animation can be configured through the `animateOptions` prop:
| duration | number | .2 | Duration of the animation (in seconds). |
255
+
| timingFunction | string | 'ease' | Function that defines the animation effect (see [animation-timing-function](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-timing-function)). |
256
+
240
257
### Callbacks
241
258
242
259
All callbacks are triggered with the following arguments:
0 commit comments