-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
data-enter
is not removed when performing exit transition before enter ends (v2.1.0
transition API regression)
#3323
Comments
I tried it in version 2.1 and the original API is still usable, like the one below, I don't know why they need to be deleted from the document, use data - * instead
|
From my perspective the new API is easier to use, but everyone has their own feelings. But issues need to be fixed for any new APIs for sure. |
@xsjcTony I think your className was written incorrectly. Please try using my writing method below <PopoverPanel
transition
// className="mt-4 ease-out data-[enter]:duration-500 data-[closed]:opacity-0 data-[closed]:translate-y-6"
className={clsx([
// Base styles
'mt-4 ease-out',
// Shared closed styles
'data-[closed]:opacity-0',
// Entering styles
'data-[enter]:duration-500 data-[enter]:data-[closed]:translate-y-6',
// Leaving styles
'data-[leave]:duration-300 data-[leave]:data-[closed]:translate-y-6',
])}
> https://headlessui.com/react/transition#different-enter-leave-transitions |
Besides, I still feel that the original API is easier to understand@RobinMalfait I would like to ask if the original API will continue to be useful in future versions
|
It's the same @LeiYao123 (I changed enter to https://stackblitz.com/edit/vitejs-vite-or4hkb?file=src%2FApp.tsx Besides, I don't want any leaving styles, and the same |
Still an issue in |
@RobinMalfait I've updated all dependencies to the latest in the reproduction, in case you need it. Thanks. |
What package within Headless UI are you using?
@headlessui/react
What version of that package are you using?
v2.1.0
What browser are you using?
Chrome
Reproduction URL
Describe your issue
The title is clear enough. Simply open the reproduction and quickly double-click the button. There is supposed to be NO exit transition, however, there is due to the
data-enter
is still there during the exit transition.I didn't check whether the same thing happens to exit -> enter quick switch. I think it worths to check that as well while fixing this.
The text was updated successfully, but these errors were encountered: