-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
What package within Headless UI are you using?
@headlessui/react
What version of that package are you using?
v2.2.9
What browser are you using?
Chrome
Reproduction URL
- https://github.com/iqqmuT/headlessui-dialog-unmount
- https://codesandbox.io/p/github/iqqmuT/headlessui-dialog-unmount/main?import=true
Describe your issue
Steps to reproduce:
- Open the web app
- Click Open dialog
- Close the dialog
- Click Go to another page
- Click Go back
- Click Open dialog
Expected outcome:
The dialog opens and looks the same as the first time.
Actual outcome:
The dialog opens behind the page container (which has opacity 95%).
This happens only when unmount={false} is given to Dialog component. It seems that <div id="headlessui-portal-root"> changes place in DOM when visiting another page in Next.js.
First:
<div class="relative..."><!-- page content --></div>
<div id="headlessui-portal-root">...</div>After navigating to another page:
<div id="headlessui-portal-root">...</div>
<div class="relative..."><!-- page content --></div>Metadata
Metadata
Assignees
Labels
No labels