Skip to content
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

Transition calls afterLeave callback too early when using Transition.Child #1364

Closed
dcastil opened this issue Apr 25, 2022 · 8 comments · Fixed by #1803
Closed

Transition calls afterLeave callback too early when using Transition.Child #1364

dcastil opened this issue Apr 25, 2022 · 8 comments · Fixed by #1803
Assignees

Comments

@dcastil
Copy link
Contributor

dcastil commented Apr 25, 2022

What package within Headless UI are you using?

@headlessui/react

What version of that package are you using?

v1.6.0

What browser are you using?

Chrome

Reproduction URL

https://codesandbox.io/s/headlessui-transition-bug-afterleave-3k435m?file=/src/App.tsx:589-1336 (link is outdated now)

Describe your issue

In v1.5.0 the afterLeave call of the Transition component was called after all Transition.Child components finished their leave animation. But now the Transition component calls this callback immediately and doesn't wait for animations of its child transition.

I rely on the afterLeave callback to know when it is safe to unmount a component with an exit animation.

@pvandamme
Copy link

Exact same problem with afterEnter

@stevebauman
Copy link

stevebauman commented May 10, 2022

Yea version >= v1.6.0 has broken exit transitions in my transitions in Vue as well 👍

@thecrypticace thecrypticace self-assigned this Jun 6, 2022
@JamieGarcia123
Copy link

I am not getting my leaveFrom transition React ^17
TW ^3 // using sass integration as well
headlessUI ^1.5.0
next ^12

@gregghawes
Copy link

Also facing this issue

@radiylon
Copy link

radiylon commented Aug 5, 2022

Looks like they're actively working on it! #1585

@RobinMalfait
Copy link
Collaborator

This should be fixed by #1803, and will be available in the next release.

You can already try it using npm install @headlessui/react@insiders.

Here is an updated CodeSandbox with the latest insiders version: https://codesandbox.io/s/headlessui-transition-bug-afterleave-forked-ukknut?file=/src/App.tsx

@dcastil
Copy link
Contributor Author

dcastil commented Sep 12, 2022

Can confirm that it works. Thanks! 🙏

@zipper
Copy link

zipper commented Feb 7, 2023

I'm now experiencing the very same issue in @headlessui/vue 1.7.9 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants