Open
Description
Bug report
Current Behavior
The container
prop of Dialog.Portal
does not update the portal.
When opening the dialog, the body
tag is still the element used for the portal element (See Stackblitz demo)
Expected behavior
The div#root
should be used as a the portal element. style="pointer-events: none;"
& data-scroll-locked="&"
should be on div#root
.
The data-radix-focus-guard
s should be in div#root
.
Reproducible example
Suggested solution
In primitive/portal, we might check mounted
is true
before containerProp
.
// Before
const container = containerProp || (mounted && globalThis?.document?.body);
// After
const container = mounted && (containerProp || globalThis?.document?.body);
Not sure if it will be sufficient to fix the bug...
Additional context
—
Your environment
See Stackblitz demo
Software | Name(s) | Version |
---|---|---|
Radix Package(s) | ||
React | 19.1.0 | |
Browser | Chrome 137.0 | |
Assistive tech | ||
Node | n/a | |
npm/yarn/pnpm | npm 10.8.2 | |
Operating System | macOS 15.5 |
Metadata
Metadata
Assignees
Labels
No labels