Skip to content

Commit e814404

Browse files
committed
fix: always clear the "Animation.onRest" queue in "SpringValue#_stop"
1 parent 9cf0a17 commit e814404

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

packages/core/src/SpringValue.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -811,9 +811,7 @@ export class SpringValue<T = any> extends FrameValue<T> {
811811
const onRestQueue = anim.onRest
812812
if (onRestQueue) {
813813
// Preserve the "onRest" prop when the goal is dynamic.
814-
if (!anim.toValues) {
815-
anim.onRest = [onRestQueue[0]]
816-
}
814+
anim.onRest = [anim.toValues ? noop : onRestQueue[0]]
817815

818816
// Never call the "onRest" prop for immediate or no-op animations.
819817
if (anim.immediate || !anim.changed) {

0 commit comments

Comments
 (0)