solidjs-motion 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,25 @@ All notable changes to `solidjs-motion` / `@solidjs-motion/motion` are documente
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.1.3] — 2026-05-21
9
+
10
+ ### Fixed
11
+
12
+ - **`onDragEnd` now fires at the very end of pan-end** (after motion's
13
+ `whileDrag` flip, body-style restore, pointer-capture release, momentum
14
+ / snap-back dispatch, AND MV-ref cleanup) instead of mid-handler. A
15
+ synchronous state flip from a user `onDragEnd` callback — e.g. closing
16
+ a Kobalte / Radix-style Dialog whose contents are the draggable — used
17
+ to race motion's later DOM-touching work and could wedge surrounding
18
+ libraries that observe the same DOM (scroll lock, pointer-event
19
+ layer-stack). The new ordering closes the race: by the time the
20
+ callback runs, the drag session is fully torn down and any reactive
21
+ cascade triggered from it is unambiguous about ownership.
22
+
23
+ Observationally compatible with the previous behavior for callbacks
24
+ that don't flip global state; users can keep their callbacks as plain
25
+ synchronous functions and drop `queueMicrotask` workarounds.
26
+
8
27
  ## [0.1.2] — 2026-05-20
9
28
 
10
29
  ### Fixed
package/dist/index.js CHANGED
@@ -1149,7 +1149,6 @@ function createDrag(el, getOpts, setActive) {
1149
1149
  setActive("whileDrag", false);
1150
1150
  restoreBodyAndElementStyles();
1151
1151
  releasePointerCaptureSafely();
1152
- getOpts().onDragEnd?.(event, info);
1153
1152
  const xRef = xMV;
1154
1153
  const yRef = yMV;
1155
1154
  const boundsRef = sessionBounds;
@@ -1245,6 +1244,7 @@ function createDrag(el, getOpts, setActive) {
1245
1244
  xMV = null;
1246
1245
  yMV = null;
1247
1246
  sessionBounds = null;
1247
+ getOpts().onDragEnd?.(event, info);
1248
1248
  };
1249
1249
  createPan(() => el, () => ({
1250
1250
  threshold: getOpts().panThreshold,