N
Nuxt9mo ago
Kars

Nuxt UI leave transitions

Hey all, seems like the leave transitions do not work using Nuxt UI. Is there a work around for it? Or some other solution to get it to work?
5 Replies
Kars
KarsOP9mo ago
Uuh I dont think that is really needed since it doesnt work anywhere, not even on the documentation
Kars
KarsOP9mo ago
https://ui.nuxt.com/components/dropdown Enter animation works fine, leave animation never triggered
Nuxt UI
Dropdown - Nuxt UI
Display a list of actions in a dropdown menu.
Kars
KarsOP9mo ago
Same goes for ContextMenu, SelectMenu etc. Basically everything that is dropdown like. It is because of this: https://github.com/nuxt/ui/blob/49b73aa024be14a9aa150a2804f4dcb18542fa49/src/runtime/components/elements/Dropdown.vue#L20 The v-if should be inside the transition, not outside. If it is outside it never triggers the transition. The appear was a quick fix but that only works for enter classes not for leave
GitHub
ui/src/runtime/components/elements/Dropdown.vue at 49b73aa024be14a9...
A UI Library for Modern Web Apps, powered by Vue & Tailwind CSS. - nuxt/ui
Kars
KarsOP9mo ago
Kars van Iersel
StackBlitz
Nuxt UI - Playground (forked) - StackBlitz
Playground of Nuxt UI, a UI library powered by Headless UI and Tailwind CSS for Nuxt.
Kars
KarsOP9mo ago
This is with the exact code from the Documentation, I copy pasted the UI transition into it and increased the leave duration to 1000 ms to make it super obvious. But as you can see, it never triggers cause of the v-if happening before the <transition>
Want results from more Discord servers?
Add your server