Skip to content

Beautiful Open-Source Form Builder

Enhance VTransition and OpenForm Components for Improved Animation and Structure

Julien Nahumedfcf5a736c6
diff --git a/client/components/global/transitions/VTransition.vue b/client/components/global/transitions/VTransition.vue
index 7fbafa303..ff778d2ed 100644
--- a/client/components/global/transitions/VTransition.vue
+++ b/client/components/global/transitions/VTransition.vue
@@ -22,6 +22,17 @@
>
<slot />
</transition>
+ <transition
+ v-else-if="name === 'fadeHeight'"
+ enter-active-class="transition-all duration-500 ease-in-out overflow-hidden"
+ enter-from-class="opacity-0 -translate-y-2 max-h-0"
+ enter-to-class="opacity-100 translate-y-0 max-h-screen"
+ leave-active-class="transition-all duration-300 ease-in-out overflow-hidden"
+ leave-from-class="opacity-100 translate-y-0 max-h-screen"
+ leave-to-class="opacity-0 -translate-y-2 max-h-0"
+ >
+ <slot />
+ </transition>
</template>
<script setup>
diff --git a/client/components/open/forms/OpenForm.vue b/client/components/open/forms/OpenForm.vue
index 743aa836c..7b3df667d 100644
--- a/client/components/open/forms/OpenForm.vue
+++ b/client/components/open/forms/OpenForm.vue
@@ -30,11 +30,13 @@
@change="handleDragDropped"
>
<template #item="{element}">
- <open-form-field
- :field="element"
- :form-manager="formManager"
- :theme="theme"
- />
+ <VTransition name="fadeHeight">
+ <open-form-field
+ :field="element"
+ :form-manager="formManager"
+ :theme="theme"
+ />
+ </VTransition>
</template>
</draggable>
</div>