primitives
primitives copied to clipboard
Dialog component should use HTML dialog
Bug report
Current Behaviour
The current implementation for the dialog use portal with div
to render the dialog.
Expected behavior
The dialog component should use the native HTML dialog behaviour to render it. This way, there will be no need to do any kind of very trick to make the z-index
property work as expected.
Reproducible example
Suggested solution
The dialog component should use the HTML dialog to render, taking advantage of the #top-layer
context provided by the browser to render on top of other elements on the page.
Your environment
Software | Name(s) | Version |
---|---|---|
Radix Package(s) | @radix-ui/react-dialog | ^1.0.5 |
React | n/a | ^18.2.0 |
Browser | Edge | 123.0.2420.81 |
Assistive tech | ||
Node | n/a | 20.12.2 |
npm/yarn | pnpm | 8.15.4 |
Operating System | Archlinux | 6.8.7-arch1-1 |
Duplicate of https://github.com/radix-ui/primitives/issues/2830 And also a very bad idea (imo)
See also:
- https://github.com/radix-ui/primitives/issues/1317#issuecomment-1094877241