-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Select not compatible with opacity transition #440
Comments
@iyume That happens because the of the <script setup lang="ts">
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectTrigger,
SelectValue,
} from "@/shadcn/components/ui/select";
import { ref } from 'vue';
const isMounted = ref(false);
const fold = ref(false);
const selected = ref();
</script>
<template>
<button @click="fold = !fold">Action</button>
<Transition enter-from-class="opacity-0" enter-active-class="transition-opacity duration-1000"
enter-to-class="opacity-100" leave-from-class="opacity-100" leave-active-class="transition-opacity duration-1000"
leave-to-class="opacity-0" @enter="isMounted = true" @leave="isMounted = false">
<div v-show="!fold" v-if='!isMounted'>
<Select v-model="selected">
<SelectTrigger class="w-[180px]">
<SelectValue placeholder="Select a fruit" />
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectLabel>Fruits</SelectLabel>
<SelectItem value="apple"> Apple </SelectItem>
<SelectItem value="banana"> Banana </SelectItem>
<SelectItem value="blueberry"> Blueberry </SelectItem>
<SelectItem value="grapes"> Grapes </SelectItem>
<SelectItem value="pineapple"> Pineapple </SelectItem>
</SelectGroup>
</SelectContent>
</Select>
</div>
</Transition>
</template> |
@stripedpurple I tried your code snippet, but it looks strange.
|
@iyume ,perhaps this issus is caused by radix-vue,I tried to combine your code with the code for the Select component in the radix-vue official doc,but I made a lot of simplifications,then encountered the same problem as you.
29.03.2024_11.13.40_REC.mp4by the way, it can work normally with only v-show |
Thanks to your solutions! Yes, it can only work with |
“I’m not sure either, but I guess it might be due to the way the source code is written in radix-vue? This is part of the code for
and i've written a piece of code here to mimic it:
here is the running effect: vif.mp4” vshow.mp4 |
Thanks to your work! I point out the related issues here: |
Reproduction
Describe the bug
Select is not compatible with opacity transition component. The text disappear (not transparent) on entering opacity transition.
System Info
Contributes
The text was updated successfully, but these errors were encountered: