Skip to content

Conversation

adiguba
Copy link
Contributor

@adiguba adiguba commented Dec 4, 2023

Fix issue #9741

CSS transition are created with fill:'both', which maintains the state of the transition on the element, even after the animation ends.

I just removed it to use the default behavior (fill:'none')

Svelte 5 rewrite

Please note that the Svelte codebase is currently being rewritten for Svelte 5. Changes should target Svelte 5, which lives on the default branch (main).

If your PR concerns Svelte 4 (including updates to svelte.dev.docs), please ensure the base branch is svelte-4 and not main.

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

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • Prefix your PR title with feat:, fix:, chore:, or docs:.
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests and linting

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

test/lint produce a lot of warnings/errors, unrelated to this change

Copy link

changeset-bot bot commented Dec 4, 2023

⚠️ No Changeset found

Latest commit: 4bbdf83

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link

vercel bot commented Dec 4, 2023

@adiguba is attempting to deploy a commit to the Svelte Team on Vercel.

A member of the Team first needs to authorize it.

@trueadm
Copy link
Contributor

trueadm commented Dec 4, 2023

I believe we tried this and this caused issues when trying to apply multiple transitions to an element at the same time (fade and fly for example). It might be better that we stop the animation rather than pause it instead.

Copy link

vercel bot commented Dec 4, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
svelte-5-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 4, 2023 7:55pm

@adiguba
Copy link
Contributor Author

adiguba commented Dec 4, 2023

I tested with cancel() instead of pause() on the onfinish handler, and it seem to work for CSS transition.

But with JS transition but it produce an incorrect tick with 0 before the final tick with one.

A JS transition like this :

	tick: (t) => {
		console.log(t);
	}

will produce something like this :

0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
0.9
0
1

@adiguba
Copy link
Contributor Author

adiguba commented Dec 4, 2023

And I don't understand why there is a pause() inside onfinish()

@trueadm
Copy link
Contributor

trueadm commented Dec 5, 2023

Thanks for your investigation, fixed this in #9778.

@trueadm trueadm closed this Dec 5, 2023
@adiguba adiguba deleted the transition-fill-mode-fix-9741 branch December 5, 2023 17:11
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.

2 participants