How to exclude an element from view transitions?

Discussão em 'Angular' iniciado por Stimmler, Janeiro 17, 2025.

  1. Stimmler

    Stimmler Guest

    I have an v17.3 Angular App and enabled view transitions using the withViewTransitions() function.

    Now, how can I exclude one specific element from the default (root) view transitions?

    ::view-transition-old(root),
    ::view-transition-new(root)


    I already tried to set the view-transition-name style property of that element to none as mentioned in the docs, disabled animations with animation: none; and set mix-blend-mode: normal;. But the element still gets animated.

    Edit: I'm using Google Chrome so the feature should be available.

    Edit2: As workaround I can disable view transitions for an element by setting the view-transition-name to disabled and providing this css:

    ::view-transition-group(disabled),
    ::view-transition-old(disabled),
    ::view-transition-new(disabled) {
    animation-duration: 0s !important;
    }

    Continue reading...

Compartilhe esta Página