[Bug] Dialog: portal DOM node isn't removed anymore
See original GitHub issueWhat package within Headless UI are you using?
What version of that package are you using?
v1.6.1
What browser are you using?
Chrome
Reproduction
- open sandbox (v1.6.1)
- reduce the window size so that mobile layout will be used
- open the sidebar via the menu button
- make the window width bigger, so that it will switch back to the desktop layout (sidebar have to be open still)
- reduce the window size so that mobile layout will be used again
- try to open the sidebar again via the menu button -> it isn’t working Reproduction URL
Not Working with v1.6.1
Working with v1.5.0
Describe your issue
Since v1.6.0
and the change regarding the Dialog.Panel
component, there is a bug where the added portal DOM node isn’t removed from the DOM anymore, when the Dialog
component is hidden by CSS.
In the sandbox i’m using tailwindUI´s sidebar template. Here is also a video demonstrating the issue.
https://user-images.githubusercontent.com/2396344/167178415-df757a53-38cc-4ed6-bec8-52445c251325.mov
Prior to v1.6.0
it was working fine.
Thx in advance for your help and support!!
Issue Analytics
- State:
- Created a year ago
- Reactions:10
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Handle heavy resource/DOM on React Portal - Stack Overflow
Just include a permanent empty div with no style (no need to use any display rules), and it will just receive all HTML...
Read more >Using React Portals to build a modal - LogRocket Blog
Learn how to build a modal or overlay component in React with React Portals. Our demo is applicable for all top level components....
Read more >Portals - React
Portals. Portals provide a first-class way to render children into a DOM node that exists outside the DOM hierarchy of the parent component....
Read more >Changelog - Cypress Documentation
Fixed a bug where projects using Node.js 16.17+ and 18.6+ with ES Modules and TypeScript were not working with Cypress. Fixes #22795, #23393,...
Read more >LTS Changelog - Jenkins
major bug fix; bug fix; major enhancement; enhancement. Community feedback: no major issues; notable issues; required rollback.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
In the app I’m working on (private repo) I’ve run into this issue using the Dialog component with transitions.
I have a modal that contains a button to close the modal, the following steps will reproduce the issue:
The issue does not happen if using escape or clicking outside the dialog to close.
Just to reiterate, the issue only happens when using an element inside the Dialog to close it, I thought it had something to do with my code but I did a straight copy/paste from the examples and still ran into the issue.
Can confirm, same issue. Clicking a close button inside the Dialog freezes the app. For now using 1.5.0 solves the issue.