framer-motion 12.24.1 → 12.24.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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var featureBundle = require('./feature-bundle-DRMwxyzS.js');
5
+ var featureBundle = require('./feature-bundle-DBjkFz2c.js');
6
6
  require('react');
7
7
  require('motion-dom');
8
8
  require('motion-utils');
@@ -5687,7 +5687,14 @@ class VisualElementDragControls {
5687
5687
  const axisValue = this.getAxisMotionValue(axis);
5688
5688
  if (projection && projection.layout) {
5689
5689
  const { min, max } = projection.layout.layoutBox[axis];
5690
- axisValue.set(point[axis] - motionDom.mixNumber(min, max, 0.5));
5690
+ /**
5691
+ * The layout measurement includes the current transform value,
5692
+ * so we need to add it back to get the correct snap position.
5693
+ * This fixes an issue where elements with initial coordinates
5694
+ * would snap to the wrong position on the first drag.
5695
+ */
5696
+ const current = axisValue.get() || 0;
5697
+ axisValue.set(point[axis] - motionDom.mixNumber(min, max, 0.5) + current);
5691
5698
  }
5692
5699
  });
5693
5700
  }
@@ -6318,4 +6325,4 @@ exports.useIsPresent = useIsPresent;
6318
6325
  exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect;
6319
6326
  exports.usePresence = usePresence;
6320
6327
  exports.visualElementStore = visualElementStore;
6321
- //# sourceMappingURL=feature-bundle-DRMwxyzS.js.map
6328
+ //# sourceMappingURL=feature-bundle-DBjkFz2c.js.map