framer-motion 6.3.7 → 6.3.8

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/dist/cjs/index.js CHANGED
@@ -474,7 +474,7 @@ var MotionValue = /** @class */ (function () {
474
474
  * This will be replaced by the build step with the latest version number.
475
475
  * When MotionValues are provided to motion components, warn if versions are mixed.
476
476
  */
477
- this.version = "6.3.7";
477
+ this.version = "6.3.8";
478
478
  /**
479
479
  * Duration, in milliseconds, since last updating frame.
480
480
  *
@@ -5972,7 +5972,7 @@ function updateMotionValuesFromProps(element, next, prev) {
5972
5972
  * and warn against mismatches.
5973
5973
  */
5974
5974
  if (process.env.NODE_ENV === "development") {
5975
- warnOnce(nextValue.version !== "6.3.7", "Attempting to mix Framer Motion versions ".concat(nextValue.version, " with 6.3.7 may not work as expected."));
5975
+ warnOnce(nextValue.version !== "6.3.8", "Attempting to mix Framer Motion versions ".concat(nextValue.version, " with 6.3.8 may not work as expected."));
5976
5976
  }
5977
5977
  }
5978
5978
  else if (isMotionValue(prevValue)) {
@@ -6704,6 +6704,9 @@ var checkAndConvertChangedValueTypes = function (visualElement, target, origin,
6704
6704
  }
6705
6705
  });
6706
6706
  if (changedValueTypeKeys.length) {
6707
+ var scrollY_1 = changedValueTypeKeys.indexOf("height") >= 0
6708
+ ? window.pageYOffset
6709
+ : null;
6707
6710
  var convertedTarget = convertChangedValueTypes(target, visualElement, changedValueTypeKeys);
6708
6711
  // If we removed transform values, reapply them before the next render
6709
6712
  if (removedTransformValues.length) {
@@ -6714,6 +6717,9 @@ var checkAndConvertChangedValueTypes = function (visualElement, target, origin,
6714
6717
  }
6715
6718
  // Reapply original values
6716
6719
  visualElement.syncRender();
6720
+ // Restore scroll position
6721
+ if (scrollY_1 !== null)
6722
+ window.scrollTo({ top: scrollY_1 });
6717
6723
  return { target: convertedTarget, transitionEnd: transitionEnd };
6718
6724
  }
6719
6725
  else {
@@ -226,6 +226,9 @@ var checkAndConvertChangedValueTypes = function (visualElement, target, origin,
226
226
  }
227
227
  });
228
228
  if (changedValueTypeKeys.length) {
229
+ var scrollY_1 = changedValueTypeKeys.indexOf("height") >= 0
230
+ ? window.pageYOffset
231
+ : null;
229
232
  var convertedTarget = convertChangedValueTypes(target, visualElement, changedValueTypeKeys);
230
233
  // If we removed transform values, reapply them before the next render
231
234
  if (removedTransformValues.length) {
@@ -236,6 +239,9 @@ var checkAndConvertChangedValueTypes = function (visualElement, target, origin,
236
239
  }
237
240
  // Reapply original values
238
241
  visualElement.syncRender();
242
+ // Restore scroll position
243
+ if (scrollY_1 !== null)
244
+ window.scrollTo({ top: scrollY_1 });
239
245
  return { target: convertedTarget, transitionEnd: transitionEnd };
240
246
  }
241
247
  else {
@@ -18,7 +18,7 @@ function updateMotionValuesFromProps(element, next, prev) {
18
18
  * and warn against mismatches.
19
19
  */
20
20
  if (process.env.NODE_ENV === "development") {
21
- warnOnce(nextValue.version !== "6.3.7", "Attempting to mix Framer Motion versions ".concat(nextValue.version, " with 6.3.7 may not work as expected."));
21
+ warnOnce(nextValue.version !== "6.3.8", "Attempting to mix Framer Motion versions ".concat(nextValue.version, " with 6.3.8 may not work as expected."));
22
22
  }
23
23
  }
24
24
  else if (isMotionValue(prevValue)) {
@@ -25,7 +25,7 @@ var MotionValue = /** @class */ (function () {
25
25
  * This will be replaced by the build step with the latest version number.
26
26
  * When MotionValues are provided to motion components, warn if versions are mixed.
27
27
  */
28
- this.version = "6.3.7";
28
+ this.version = "6.3.8";
29
29
  /**
30
30
  * Duration, in milliseconds, since last updating frame.
31
31
  *
@@ -1699,7 +1699,7 @@
1699
1699
  * This will be replaced by the build step with the latest version number.
1700
1700
  * When MotionValues are provided to motion components, warn if versions are mixed.
1701
1701
  */
1702
- this.version = "6.3.7";
1702
+ this.version = "6.3.8";
1703
1703
  /**
1704
1704
  * Duration, in milliseconds, since last updating frame.
1705
1705
  *
@@ -7197,7 +7197,7 @@
7197
7197
  * and warn against mismatches.
7198
7198
  */
7199
7199
  {
7200
- warnOnce(nextValue.version !== "6.3.7", "Attempting to mix Framer Motion versions ".concat(nextValue.version, " with 6.3.7 may not work as expected."));
7200
+ warnOnce(nextValue.version !== "6.3.8", "Attempting to mix Framer Motion versions ".concat(nextValue.version, " with 6.3.8 may not work as expected."));
7201
7201
  }
7202
7202
  }
7203
7203
  else if (isMotionValue(prevValue)) {
@@ -7929,6 +7929,9 @@
7929
7929
  }
7930
7930
  });
7931
7931
  if (changedValueTypeKeys.length) {
7932
+ var scrollY_1 = changedValueTypeKeys.indexOf("height") >= 0
7933
+ ? window.pageYOffset
7934
+ : null;
7932
7935
  var convertedTarget = convertChangedValueTypes(target, visualElement, changedValueTypeKeys);
7933
7936
  // If we removed transform values, reapply them before the next render
7934
7937
  if (removedTransformValues.length) {
@@ -7939,6 +7942,9 @@
7939
7942
  }
7940
7943
  // Reapply original values
7941
7944
  visualElement.syncRender();
7945
+ // Restore scroll position
7946
+ if (scrollY_1 !== null)
7947
+ window.scrollTo({ top: scrollY_1 });
7942
7948
  return { target: convertedTarget, transitionEnd: transitionEnd };
7943
7949
  }
7944
7950
  else {