Fixed grow animation not working on nodes disappearing

This commit is contained in:
thepaperpilot 2021-08-26 00:28:03 -05:00
parent af57840dc6
commit 1709fe3079
2 changed files with 106 additions and 105 deletions

View file

@ -20,9 +20,9 @@
<BoardLink :link="link" /> <BoardLink :link="link" />
</g> </g>
</transition-group> </transition-group>
<transition-group name="grow" :duration="500" appear>
<g v-for="node in nodes" :key="node.id" style="transition-duration: 0s">
<BoardNode <BoardNode
v-for="node in nodes"
:key="node.id"
:node="node" :node="node"
:nodeType="board.types[node.type]" :nodeType="board.types[node.type]"
:dragging="draggingNode" :dragging="draggingNode"
@ -33,6 +33,8 @@
@endDragging="endDragging" @endDragging="endDragging"
/> />
</g> </g>
</transition-group>
</g>
</svg> </svg>
</panZoom> </panZoom>
</template> </template>

View file

@ -44,8 +44,8 @@
</g> </g>
</transition> </transition>
<transition name="grow" appear>
<g <g
class="node-container"
@mouseenter="mouseEnter" @mouseenter="mouseEnter"
@mouseleave="mouseLeave" @mouseleave="mouseLeave"
@mousedown="mouseDown" @mousedown="mouseDown"
@ -134,7 +134,6 @@
<text :fill="titleColor" class="node-title">{{ title }}</text> <text :fill="titleColor" class="node-title">{{ title }}</text>
</g> </g>
</transition>
<transition name="fade" appear> <transition name="fade" appear>
<text <text
@ -386,11 +385,6 @@ export default defineComponent({
opacity: 0.25; opacity: 0.25;
} }
} }
.grow-enter-from,
.fade-leave-to {
transform: scale(0);
}
</style> </style>
<style> <style>
@ -398,4 +392,9 @@ export default defineComponent({
.actions-leave-to .action { .actions-leave-to .action {
transform: translate(0, 0); transform: translate(0, 0);
} }
.grow-enter-from .node-container,
.grow-leave-to .node-container {
transform: scale(0);
}
</style> </style>