Skip to content

<keep-alive> within <transition-group> blocks leave transitions #10021

@sathomas

Description

@sathomas

Version

2.6.10

Reproduction link

https://codepen.io/sathomas/pen/Jqoyqo

Steps to reproduce

Component structure:

<transition-group>
  <keep-alive>
    <component />
  </keep-alive>
</transition-group>

Change dynamic component. Leave transition does not occur.

In repro example, click Switch View

  • Note 1: In repro example if <keep-alive> is removed via checkbox, all transitions work as expected.
  • Note 2: In repro example if <transition-group> is replaced with <transition>, all transitions work as expected.

What is expected?

Initial component should transition out while new component transitions in.

What is actually happening?

Initial component is removed immediately while new component transitions in.


In actual use case, v-show is not a good option as the dynamic components involved are quite complex (1000s of DOM elements) and leaving them in the actual DOM causes performance problems.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions