Skip to content

Commit 3904791

Browse files
committed
Update AlertDialogPortal to handle multiple root elements
1 parent a741b01 commit 3904791

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/ui/AlertDialog/fragments/AlertDialogPortal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ export type AlertDialogPortalProps = {
88

99
const AlertDialogPortal = ({ children }: AlertDialogPortalProps) => {
1010
const { rootClass } = useContext(AlertDialogContext);
11-
const rootElement = document.querySelector('#rad-ui-theme-container') as HTMLElement | null;
12-
console.log(rootElement);
11+
const rootElement = document.querySelector('#rad-ui-theme-container') || document.body as HTMLElement | null;
12+
1313
return (
1414
<Floater.Portal
1515
root={rootElement}

0 commit comments

Comments
 (0)