-
Notifications
You must be signed in to change notification settings - Fork 708
[css-view-transitions-1] Named elements appear above fixed elements when transitioning #8941
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
Comments
Unfortunately, this is the API working as intended. View Transition has to figure out how to animate multiple aspects of the DOM changing. One of those is the paint order which can't be interpolated so we had to pick some paint order. And the way it works is:
The paint order here derives from the DOM order of In this case ::view-transition-group(footer) {
z-index: 100;
} One approach we could try would be something like :
Then combine these in the best way possible. For example, in the above case [A, D, B, C] would make sense. But if the 2 lists are [A, B, C] and [A, D] then its not clear what the ordering should be. Current spec would do [A, B, C, D] which seems fine, authors can always use z-index to fix the paint order. I'm open to suggestion here, not sure if the pattern in this issue is common enough for us to change the way we order the pseudos vs chalking it up to an edge case where authors should use z-index. |
Gonna close this, we'll need a fairly complicated algorithm for deciding the paint order here to get every case right. Since there is an easy way for authors to do this way, with a primitive that's meant for this purpose, it doesn't feel worth it. |
Any new development on this topic? I'm having this issue. |
Scoped View Transitions will allow you to solve this: you’d start a View Transition on an element that excludes the In the mean time, you can work around it by giving the element that is |
Please see the following codepen: https://codepen.io/danchristofi/pen/abQzMLM
When adding a class to make the box visible, it appears over the top of the fixed element. In this example the red bar is fixed to the bottom of the page with the box behind it. After the animation is finished the box returns behind the footer.

Removing the view-transition-name from the box stops this happening, but it would be needed if you want a custom animation.
Is this a bug or is there any extra styling needed to get this to work correctly?
The text was updated successfully, but these errors were encountered: