Re: [csswg-drafts] [css-view-transitions-1] Allow to control whether make a particular group when the named element was there only in one side (#8528)

> If there is no `view-transition-name` property on one side of the transition, I want to make that element belong to `::view-transition-group(root)`. (In above example, transitions when navigating 1 ↔︎ 2 and 3 ↔︎ 4)

This isn't currently possible, because the old view is captured before the new view is available.

As a developer, you could create the new view, but detached from the document, then crawl the DOM to see if the new view has an equivalent `view-transition-name`, and if it doesn't, remove it from the old view. If you do this before calling `startViewTransition`, you'll get the effect you want.

In future, we want to work on 'nested transitions', which allows you to specify that one `::view-transition-group` should be nested within another `::view-transition-group`. This might help here, if you could conditionally nest a group in the root group.

-- 
GitHub Notification of comment by jakearchibald
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8528#issuecomment-1458352639 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 7 March 2023 15:18:35 UTC