tailwindlabs / headlessui

Completely unstyled, fully accessible UI components, designed to integrate beautifully with Tailwind CSS.
https://headlessui.com
MIT License
25.02k stars 1.03k forks source link

Sibling/nested dialogs: Wrong dialog is closed when the first dialog is open at mount time, when using StrictMode #3330

Open nuschk opened 6 days ago

nuschk commented 6 days ago

What package within Headless UI are you using?

@headlessui/react

What version of that package are you using?

2.1.0

What browser are you using?

Chrome, Safari

Reproduction URL

https://playcode.io/1918392

Describe your issue

Sorry for the long title, didn't know how to get it more concise 🫣. It only happens when using <StrictMode /> , although I must say, IME, that always points to a real error, so I suspect it's a bug.

BTW, my use-case is the dialog is bound to a specific URL in a tanstack-router app.

Also:

And thank you so much for making sibling dialogs work! I've been waiting for it since... ever!