Transition with mode="in-out" does not remove old element when no other element to transition "in" is present
Version
3.0.5
Reproduction link
https://jsfiddle.net/5j9hmL70/
Steps to reproduce
- Press button "TOGGLE"
What is expected?
Text "toggled" should disappear.
What is actually happening?
Text "toggled" does not disappear.
I found this problem in a more complex constellation with vue-router, where the optional component does not disappear:
<router-view name="document" v-slot="{ Component }">
<transition name="tri-view-document" mode="in-out">
<component v-if="activeDocument" :is="Component" :key="activeDocument.id"/>
</transition>
</router-view>
When toggling branches with in-out mode, the branch being entered maybe a comment node, which makes the transition invalid and never completes. this PR checks the type of node being entered.