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

Ensure Transition component completes if nothing is transitioning #2318

Merged
merged 3 commits into from
Feb 28, 2023

Conversation

RobinMalfait
Copy link
Member

This PR fixes an issue where the Transition component causes sub-components (like a Dialog) to get "stuck" because it nevers finishes transitioning.

This can happen if there is nothing to transition at all (e.g.: display: block; -> display: none;).

If this happens then the transitionend event is never fired and therefore it's waiting for nothing and gets stuck.

Fixes: #2114

@vercel
Copy link

vercel bot commented Feb 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
headlessui-react ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 28, 2023 at 11:31AM (UTC)
headlessui-vue ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 28, 2023 at 11:31AM (UTC)

Also added a `group` function, this allows us to spawn a _sub_
disposables group that can be disposed on its own, but will also be
disposed the moment the "parent" is disposed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

headlessui-portal-root doesn't delete on modal close when using a Transition that doesn't fade
1 participant