Skip to content

Commit b896745

Browse files
committed
Updating changelog
1 parent f432518 commit b896745

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ Motion adheres to [Semantic Versioning](http://semver.org/).
44

55
Undocumented APIs should be considered internal and may change without warning.
66

7+
## [12.21.0] 2025-07-01
8+
9+
### Added
10+
11+
- Allow `distanceThreshold` to be configurable via `useDragControls`.
12+
713
## [12.20.5] 2025-07-01
814

915
### Fixed

packages/framer-motion/src/gestures/drag/VisualElementDragControls.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,18 @@ export const elementDragControls = new WeakMap<
3636
>()
3737

3838
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+
*/
4251
snapToCursor?: boolean
4352
}
4453

packages/framer-motion/src/gestures/pan/PanSession.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ interface PanSessionHandlers {
2323
interface PanSessionOptions {
2424
transformPagePoint?: TransformPoint
2525
dragSnapToOrigin?: boolean
26-
distanceThreshold?: number;
26+
distanceThreshold?: number
2727
contextWindow?: (Window & typeof globalThis) | null
2828
}
2929

@@ -94,7 +94,7 @@ export class PanSession {
9494
handlers: Partial<PanSessionHandlers>,
9595
{
9696
transformPagePoint,
97-
contextWindow,
97+
contextWindow = window,
9898
dragSnapToOrigin = false,
9999
distanceThreshold = 3,
100100
}: PanSessionOptions = {}

0 commit comments

Comments
 (0)