Skip to content

Issue with spring, setting a hard value then immediately setting a regular transition #7917

Open
@johnnysprinkles

Description

@johnnysprinkles

Describe the bug

I'm using a spring to scroll a particular line of a song into view. If they scroll more than 1000px it's a little slow, so I jump it ahead 90% of the way immediately and let the last 10% animate. I made a similar repro case animating a red box.

The issue is, intermittently, the "non-hard" setting doesn't animate. See the repro below.

Reproduction

https://svelte.dev/repl/74f1dbcfe96e4a7b8408ab9e8c0abdd3?version=3.50.1

If you move the box less than half way across its range, it just animates normally. If you're moving more than 50, it'll jump it immediately to 90% of the destination value. This works some of the time but not all of the time. Sometimes it snaps and freezes without animating that last 10%. Try clicking between 10 and 90 and 10 and 90, you'll see what I mean.

Logs

No response

System Info

System:
    OS: macOS 12.6
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 2.02 GB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/node
    Yarn: 1.22.17 - /opt/brew/bin/yarn
    npm: 8.3.1 - ~/.nvm/versions/node/v16.14.0/bin/npm
  Browsers:
    Chrome: 106.0.5249.103
    Firefox: 99.0.1
    Safari: 16.0
    Safari Technology Preview: 16.4
  npmPackages:
    svelte: ^3.44.0 => 3.48.0

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    runtimeChanges relating to runtime APIs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions