-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Add support for "on-site" view transitions #55829
Comments
The current view transition api is best used for whole-page transitions and not really meant for the use-case you’re describing. I think what you’re looking for is the scope transitions proposal. Aside from that, there’s not really a need for an injectable that’s just a wrapper around the native view transition function. You can just call that directly yourself, make updates to application state, and return a promise that resolves with Unless there’s something I’m missing here, I think this issue can be closed. |
We're definitely excited by the potential of scoped transitions :) but I agree with Andrew, there's nothing we can do at the moment. |
@atscott and @alxhub, thank you for your feedback. I agree with you that the view transitions were not directly developed for such a use case. But developers are creative, and even Bramus shows such use cases when he talks about view transitions. So, I think people will try it. That's why I first came up with the idea that it might be a great addition to Angular if we offered developers the use here with a simple API. I also agree that the scope transitions proposal fits the use case better. Until then, we can at least make do with your suggested approach of using the "afterNextRender" promise and experiment. Thanks for that hint! |
Which @angular/* package(s) are relevant/related to the feature request?
No response
Description
The current implementation of the View Transition API with the
withViewTransitions()
router feature enables view transition in our applications' routing context. However, it is essential to remember that there are also ‘on-site’ use cases for the View Transition API to make transitions within a view more visually appealing.Examples of such cases would be, for example, sorting lists or even opening and closing accordions, as shown in the following examples:
In order to open up these possibilities to Angular developers, a corresponding API is required that makes it possible to visualise ‘on-site’ DOM changes with the help of a view transition.
Proposed solution
A possible developer API could include a global injectable
ViewTransitionRef
that offers astartTransition
function which takes, corresponding to the originaldocument.startViewTransition()
function, a callback function which includes the actions that lead to the actual DOM Change.Alternatives considered
The text was updated successfully, but these errors were encountered: