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
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>
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
Describe your issue
Steps to reproduce:
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:
After navigating to another page: