-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Nesting Astro components prevents transition directives from animating #8392
Comments
I don't think that the fix that landed in 3.0.12 has fixed the stackblitz linked in the original post. If you go to the stackblitz link, update Astro to 3.0.12 and click the "Not working" link you'll see that you only get a full page cross-fade transition. On inspecting the (on the not working page, not the landing page) you can see it has a data-astro-transition-scope but no CSS with a view-transition-name for it has been generated. |
Ah, thanks, will take a look. |
You are right. I have updated the Link to Minimal Reproducible Example to Astro 3.0.12 and unfortunately, it does not resolve the issue. Thanks for looking into the issue @matthewp |
Fwiw, an even more condensed version https://stackblitz.com/edit/github-ojxahh-hrpswf?file=package.json,src%2Fpages%2Findex.astro Boils down to this
|
Are you happening to use |
Not in this reproduction ☝️ |
No, transition:name and transition:persist are not used on the same element on the Minimal Reproducible Example or in my production code. Only transition:name and transition:animate are being used together. |
Thanks, this is the top of my list of issues to fix. |
I'm pretty sure I know what's causing this. |
So what's happening here is we use this plugin to track dependencies, so we know which components are going to be appending styles (and scripts) to the head: https://github.com/withastro/astro/blob/main/packages/astro/src/vite-plugin-head/index.ts When we find a component that does this, such as one that has transition styles, it walks up the tree and marks parent components as having head metadata in them (the In Image reproduction what happen is, the Image component loads on the index page, it walks up its parents, but the The fix is that when a new module comes in, we need to check if it is marked as |
PR up: #8646 |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Nested View Transitions stop animating when HTML with Transition Directives is nested too deep within Astro components.
e.g. when nesting an image
This level of nesting works
This level of nesting or more does not work
If I can help make this issue clearer please let me know.
What's the expected result?
Nested View Transitions to animate no matter how deeply they are nested.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-ojxahh?file=src%2Fpages%2Findex.astro
Participation
The text was updated successfully, but these errors were encountered: