Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cache value & cancel tween for instant-set #4847

Merged
merged 1 commit into from
May 17, 2020

Conversation

tivac
Copy link
Contributor

@tivac tivac commented May 16, 2020

Fixes #4846

Now when the early-out branch is taken for a duration of 0 it will do two things that were missing in the first implementation:

  1. It will cancel any tweens that are in-progress so the value doesn't keep changing after snapping to the specified value.
  2. It will cache off the value correctly, so that later tweens use the correct starting point.

Is there a better way to test this within the current suite? The mocha tests don't have access to any browser globals so you can't actually test any tweens and given how broken this was after #4766 the lack of test coverage makes me nervous.

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR relates to an outstanding issue, so please reference it in your PR, or create an explanatory one for discussion. In many cases features are absent for a reason.
  • This message body should clearly illustrate what problems it solves. If there are related issues, remember to reference them.
  • Ideally, include a test that fails without this PR but passes with it. PRs will only be merged once they pass CI. (Remember to npm run lint!)

Tests

  • Run the tests tests with npm test or yarn test)

@tivac
Copy link
Contributor Author

tivac commented May 17, 2020

Also fixes #4799, since my bug was actually a dupe of that one.

@Conduitry Conduitry merged commit ef2a886 into sveltejs:master May 17, 2020
taylorzane pushed a commit to taylorzane/svelte that referenced this pull request Dec 17, 2020
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.

Tweened store updates with 0 duration leave store in corrupted state
2 participants