File tree Expand file tree Collapse file tree 3 files changed +20
-5
lines changed
packages/framer-motion/src/gestures Expand file tree Collapse file tree 3 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,12 @@ Motion adheres to [Semantic Versioning](http://semver.org/).
4
4
5
5
Undocumented APIs should be considered internal and may change without warning.
6
6
7
+ ## [ 12.21.0] 2025-07-01
8
+
9
+ ### Added
10
+
11
+ - Allow ` distanceThreshold ` to be configurable via ` useDragControls ` .
12
+
7
13
## [ 12.20.5] 2025-07-01
8
14
9
15
### Fixed
Original file line number Diff line number Diff line change @@ -36,9 +36,18 @@ export const elementDragControls = new WeakMap<
36
36
> ( )
37
37
38
38
export interface DragControlOptions {
39
- /** The distance after which dragging starts. */
40
- distanceThreshold ?: number ;
41
- /** Whether to immediately snap to the cursor when dragging starts. */
39
+ /**
40
+ * This distance after which dragging starts and a direction is locked in.
41
+ *
42
+ * @public
43
+ */
44
+ distanceThreshold ?: number
45
+
46
+ /**
47
+ * Whether to immediately snap to the cursor when dragging starts.
48
+ *
49
+ * @public
50
+ */
42
51
snapToCursor ?: boolean
43
52
}
44
53
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ interface PanSessionHandlers {
23
23
interface PanSessionOptions {
24
24
transformPagePoint ?: TransformPoint
25
25
dragSnapToOrigin ?: boolean
26
- distanceThreshold ?: number ;
26
+ distanceThreshold ?: number
27
27
contextWindow ?: ( Window & typeof globalThis ) | null
28
28
}
29
29
@@ -94,7 +94,7 @@ export class PanSession {
94
94
handlers : Partial < PanSessionHandlers > ,
95
95
{
96
96
transformPagePoint,
97
- contextWindow,
97
+ contextWindow = window ,
98
98
dragSnapToOrigin = false ,
99
99
distanceThreshold = 3 ,
100
100
} : PanSessionOptions = { }
You can’t perform that action at this time.
0 commit comments