diff --git a/.changeset/shy-carpets-rescue.md b/.changeset/shy-carpets-rescue.md new file mode 100644 index 0000000000..0c7fc6687c --- /dev/null +++ b/.changeset/shy-carpets-rescue.md @@ -0,0 +1,5 @@ +--- +'svelte': patch +--- + +Overwrite Spring.#last_value when using .set() with {instant: true} diff --git a/packages/svelte/src/motion/spring.js b/packages/svelte/src/motion/spring.js index 270fabd4c7..bc30ce9578 100644 --- a/packages/svelte/src/motion/spring.js +++ b/packages/svelte/src/motion/spring.js @@ -282,6 +282,7 @@ export class Spring { this.#task?.abort(); this.#task = null; set(this.#current, set(this.#target, value)); + this.#last_value = value; return Promise.resolve(); }