This repository has been archived by the owner on Jan 11, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 432
[Bug] Hydratation issue causes CSS animations to restart #1088
Comments
sandrina-p
changed the title
Hydratation issue causes CSS animations to restart.
[Bug] Hydratation issue causes CSS animations to restart.
Feb 12, 2020
sandrina-p
changed the title
[Bug] Hydratation issue causes CSS animations to restart.
[Bug] Hydratation issue causes CSS animations to restart
Feb 12, 2020
This was referenced Feb 13, 2020
sandrina-p
added a commit
to sandrina-p/portfolio_v3
that referenced
this issue
Feb 13, 2020
sandrina-p
added a commit
to sandrina-p/portfolio_v3
that referenced
this issue
Feb 13, 2020
@sandrina-p I can't see the PR Avi opened. Can you post the link please? |
@antony the PR from Avi is to svelte repo: sveltejs/svelte#4309 |
Closing this in favor of the issue in the Svelte repo |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
I'm building a webpage with some CSS animations that start as soon as the DOM is mounted (with SSR). When the JS is loaded (after a few seconds), the animations are already ongoing or even finished. But then Sapper (or Svelte?) re-attaches the whole DOM and this causes the CSS animations to start again.
Logs
I think there are no relevant logs here.
To Reproduce
Here's a GIF to demonstrate the issue: When the animation "Oh, hey there!" restarts is the moment the JS (Svelte) is executed causing the CSS animation to restart.
The source code: https://github.com/sandrina-p/s008080_2019
Tip: Use Fast 3G to simulate a "slow" internet and CSS starts before JS is finished loading. If the page loads too fast (when cashed) you might not notice this bug because the JS loaded before the CSS animation has started.
Expected behavior
When Svelte loads, it shouldn't re-attach the whole DOM. Instead, it should be smarter and reuse the same nodes.
Information about your Sapper Installation:
Severity
This is blocking me from releasing the website using Sapper. The whole point of using CSS animations right on mount is to decrease the perceived page load time, so people don't realize the site is still loading. If I'm forced to only load these CSS animations when JS is loaded, the main goal of reducing perceived load time fails.
Additional context
I found this bug, might be related: sveltejs/svelte#4308
Update: I tested a fork made by @avi on my project (see commit sandrina-p/portfolio_v3@d4a81d2) and it worked! @avi also opened a PR. Once it's merged I believe it will fix this issue too sveltejs/svelte#4309
The text was updated successfully, but these errors were encountered: