svelte icon indicating copy to clipboard operation
svelte copied to clipboard

Reducing a spring's value causes it to jump forward, first

Open arackaf opened this issue 3 years ago • 0 comments

Describe the bug

If there's a spring with a value of, say, 86, and that value is reduced to 0, the value first jumps forward, sometimes by a lot, before reducing to zero.

Reproduction

https://stackblitz.com/edit/vitejs-vite-rnwjqz?file=src%2FApp.svelte,package.json&terminal=dev

Open the div, then close it, and check the console. I'm logging the values each step of the way.

From the screenshot, after opening, the height is 86. Before reducing the 0, it jumped forward by 12. The jump isn't always this bad, but when it is, it causes a noticeable jump in the content, before collapsing.

I've found that after a few iterations, the spring gets it more correct with "more practice" so if it's not reproducing well, reloading the entire StackBlitz page often helps.

image

Logs

See screenshot

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 16.14.2 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 7.17.0 - /usr/local/bin/npm
  npmPackages:
    svelte: ^3.54.0 => 3.54.0

Severity

annoyance

arackaf avatar Dec 08 '22 17:12 arackaf