Skip to content

Commit db37e33

Browse files
committed
Add transition animation to Popover and adjust ListBox teleport structure
1 parent d3cf91c commit db37e33

File tree

2 files changed

+26
-20
lines changed

2 files changed

+26
-20
lines changed

frontend/src/ui-components/components/Popover.vue

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,25 @@
1616
</span>
1717
</PopoverButton>
1818
<teleport to="body">
19-
<PopoverPanel
20-
v-if="open"
21-
v-slot="{ close }"
22-
ref="menu-items"
23-
class="fixed w-full overflow-auto bg-white border border-gray-200 rounded-md shadow-md z-[200]"
24-
:style="{
25-
top: position.top + 'px',
26-
left: position.left + 'px',
27-
width: 'fit-content'
28-
}"
19+
<transition
20+
leave-active-class="transition duration-100 ease-in"
21+
leave-from-class="opacity-100"
22+
leave-to-class="opacity-0"
2923
>
30-
<slot name="panel" :close="close" />
31-
</PopoverPanel>
24+
<PopoverPanel
25+
v-if="open"
26+
v-slot="{ close }"
27+
ref="menu-items"
28+
class="fixed w-full overflow-auto bg-white border border-gray-200 rounded-md shadow-md z-[200]"
29+
:style="{
30+
top: position.top + 'px',
31+
left: position.left + 'px',
32+
width: 'fit-content'
33+
}"
34+
>
35+
<slot name="panel" :close="close" />
36+
</PopoverPanel>
37+
</transition>
3238
</teleport>
3339
</Popover>
3440
</template>

frontend/src/ui-components/components/form/ListBox.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
</span>
2727
</ListboxButton>
2828

29-
<transition
30-
leave-active-class="transition duration-100 ease-in"
31-
leave-from-class="opacity-100"
32-
leave-to-class="opacity-0"
33-
>
34-
<teleport to="body">
29+
<teleport to="body">
30+
<transition
31+
leave-active-class="transition duration-100 ease-in"
32+
leave-from-class="opacity-100"
33+
leave-to-class="opacity-0"
34+
>
3535
<ListboxOptions
3636
v-if="open"
3737
ref="menu-items"
@@ -64,8 +64,8 @@
6464
</ListboxOption>
6565
</slot>
6666
</ListboxOptions>
67-
</teleport>
68-
</transition>
67+
</transition>
68+
</teleport>
6969
</div>
7070
</Listbox>
7171
</template>

0 commit comments

Comments
 (0)