Transition calls `afterLeave` callback too early when using `Transition.Child`
See original GitHub issueWhat package within Headless UI are you using?
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.
Issue Analytics
- State:
- Created a year ago
- Reactions:10
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Transition - Headless UI
The Transition component lets you add enter/leave transitions to conditionally rendered elements, using CSS classes to control the actual transition styles ...
Read more >Invoke a callback at the end of a transition - Stack Overflow
Hi , the first link to stack/group bar chart points to an Observable notebook which doesn't use any .each event listener, nor the...
Read more >Transition | Vue.js
Vue offers two built-in components that can help work with transitions and animations in response to changing state: <Transition> for applying animations ...
Read more >Preparing for Transition from Early Intervention to an IEP
You can learn new skills and strategies that may help with future transitions. Moving from “family focus” to a “child focus”. Under the...
Read more >@headlessui/react - npm
The Transition component lets you add enter/leave transitions to conditionally rendered elements, using CSS classes to control the actual transition styles ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.tsxLooks like they’re actively working on it! https://github.com/tailwindlabs/headlessui/pull/1585