I have run into a problem trying to transition content shifts. Essentially my data array is displayed in different parts of the DOM depending on state.
Basic concept:
OPEN
- feedback 1 [ complete ]
- feedback 2 [ complete ]
- feedback 3 [ complete ]
CLOSED
What I try to achieve: When you press "close", feedback fades out from OPEN and fades in under the CLOSED section
This is what I tried: Rendering "Closed" items with a transition:
<transition name="fade">
<v-row v-if="feedbackItem.state ==='closed'" v-for="feedbackItem in closedTasks" :key="feedbackItem.id">
<p>
{{ feedbackItem.feedback }}
</p>
</v-row>
</transition>
<style>
.fade-enter-active, .fade-leave-active {
transition: opacity .5s;
}
.fade-enter, .fade-leave-to {
opacity: 0;
}
</style>
But it does not work as needed (no visible transition), and elements under "Closed" are even hidden if there are multiple closed items. I think it has to do with the way the computed item lists are rendered. Possibly the line v-if="feedbackItem.state ==='closed'" causes a problem. Does anyone perhaps know how to best achieve the desired result or what am I doing wrong?
Codepen to play around with is here.
Thanks for anyone who spares a moment to think along!