Skip to content

Conversation

@grieben
Copy link
Contributor

@grieben grieben commented Dec 10, 2024

Fixes #14645

After using the {instant: true} option with Spring.set(), a subsequent (non-instant) .set() sometimes displayed unexpected behavior. See Issue link for reproduction, .gif of example, and more details.

This PR overwrites the Spring's #last_value after updating instantly so that no data/context from before the instant .set() lingers to interfere with future .set()s. After building this modified version of svelte and linking it to a sveltekit project, I no longer see the glitchy behavior described in the Issue linked above.

I saw no tests in the /svelte/tests/ directory that use the newly created Spring class and don't feel currently knowledgeable enough to write a full suite myself. I'm also unsure how I would test the private #last_value property. If tests are necessary, please let me know and I will do my best to provide them.

Tests and linting

  • Run the tests with pnpm test and lint the project with pnpm lint

@changeset-bot
Copy link

changeset-bot bot commented Dec 10, 2024

🦋 Changeset detected

Latest commit: 09ab0e9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
svelte Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

Playground

pnpm add https://pkg.pr.new/svelte@14656

@Rich-Harris Rich-Harris merged commit a26b6d8 into sveltejs:main Dec 10, 2024
10 checks passed
@Rich-Harris
Copy link
Member

thank you!

@github-actions github-actions bot mentioned this pull request Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5.8.0 Spring instant option unexpected behavior.

2 participants