disable user agent view-transition root conditionally
Is there a way to disable the standard user agent view transition manually before updating the dom?
I know I can do:
But I am asking because when I explicitly not want to use my view transition (as in not setting the view-transition-name dynamically on the elements) the standard root transition just does its thing and there's no way for me to stop that unless I remove it entirely. That is of course annoying because I'd have to change quite a few other things on my project where I'd want to use it without thinking about it.
I am using Angular if that information is necessary although it shouldn't(?). Hope someone can help me with this problem.
I am most likely just not seeing the obvious solution here.
3 Replies
The first thing I tried was to set an empty view-transition with a duration of 0 to the elements so that the root transition wouldn't trigger but somehow it still does.
Even on my working view-transition the root transition always gets triggered which is also something I didn't understand.
this is most certainly not the best solution but I just now add this class
to the document.documentElement before my view-transition and remove it after. that way it doesn't interfere although I still do not know why it would do that in the first place.