Skip to content

fix(vue): skip deleting portal root node to avoid race condition #3745

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

fabis94
Copy link

@fabis94 fabis94 commented Jun 20, 2025

Even w/ the latest version of HeaadlessUI for Vue I was running into an issue where if a new dialog starts opening up while a previous dialog is in the process of closing down you can run into an issue where the old dialog starts removing the shared PortalRoot while the new dialog has already chosen to rely on it as its PortalRoot. This then ends up breaking the rendering of the 2nd dialog as it ends up being unmounted from the DOM along with the PortalRoot.

The fix is easy - just skip removing the portal root. I don't see any real benefits for removing it, I mean its just one single empty div node, there's no performance gain to having it be removed, and keeping it around fixes the race condition issue.

Copy link

vercel bot commented Jun 20, 2025

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

Name Status Preview Comments Updated (UTC)
headlessui-react ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 20, 2025 2:29pm
headlessui-vue ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 20, 2025 2:29pm

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.

1 participant