motion-dom 12.34.2 → 12.34.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/dist/cjs/index.js
CHANGED
|
@@ -886,6 +886,11 @@ function getSpringOptions(options) {
|
|
|
886
886
|
// stiffness/damping/mass overrides duration/bounce
|
|
887
887
|
if (!isSpringType(options, physicsKeys) &&
|
|
888
888
|
isSpringType(options, durationKeys)) {
|
|
889
|
+
// Time-defined springs should ignore inherited velocity.
|
|
890
|
+
// Velocity from interrupted animations can cause findSpring()
|
|
891
|
+
// to compute wildly different spring parameters, leading to
|
|
892
|
+
// massive oscillation on small-range animations.
|
|
893
|
+
springOptions.velocity = 0;
|
|
889
894
|
if (options.visualDuration) {
|
|
890
895
|
const visualDuration = options.visualDuration;
|
|
891
896
|
const root = (2 * Math.PI) / (visualDuration * 1.2);
|
|
@@ -901,7 +906,7 @@ function getSpringOptions(options) {
|
|
|
901
906
|
};
|
|
902
907
|
}
|
|
903
908
|
else {
|
|
904
|
-
const derived = findSpring(options);
|
|
909
|
+
const derived = findSpring({ ...options, velocity: 0 });
|
|
905
910
|
springOptions = {
|
|
906
911
|
...springOptions,
|
|
907
912
|
...derived,
|