-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
fix: improve transition outro effect #10220
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
Conversation
🦋 Changeset detectedLatest commit: df91fd5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Thank you @trueadm, ALMOST perfect. The easing indeed seems to have been fixed, however, a new issue is that the outro transition now goes beyond the initial position of the element — in this video, notice how the the first time the checkbox is toggled, the outro transition ends with the element having a little bit of space on the left, whereas the second time, it goes too far to the left (repro): Rec.0017.mp4 |
Update: I'm still not happy with this (I pushed some fixes but they're not right still). It turns out that this is far more complicated to get right. Here is the working example I've been using locally to test this with: <script>
import { fly } from 'svelte/transition';
import { cubicOut } from 'svelte/easing';
let show = false;
</script>
<label for="show">show:</label><input type="checkbox" id="show" bind:checked={show} />
{#if show}
<h1 transition:fly={{ duration: 2000, easing: cubicOut, x: -200, opacity: 0.5 }}>Hello World!</h1>
{/if}
<h1>Hello World!</h1>
<h1 style="transform: translateX(-200px)">Hello World!</h1>
<style>
h1 {
margin: auto;
width: fit-content;
}
</style> @Rich-Harris I wonder if you have some bandwidth if you could play around with this and see if you can discover anything? Specifically if you play around with the logic in |
6d91646
to
0e10687
Compare
29a1477
to
e96b0fc
Compare
e96b0fc
to
df91fd5
Compare
@trueadm what was the conclusion here? i'd have loved to see this fixed. |
@xamir82 This is fixed now :) |
Fixes #10219.