Render modal via portal to body for true viewport centering
Made-with: Cursor
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import { useState, useEffect, useRef } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { toast } from 'sonner';
|
||||
|
||||
@@ -76,7 +77,7 @@ export function ProjectCreationModal({ open, onOpenChange, workspace }: ProjectC
|
||||
|
||||
if (!open) return null;
|
||||
|
||||
return (
|
||||
return createPortal(
|
||||
<>
|
||||
{/* Backdrop */}
|
||||
<div
|
||||
@@ -271,6 +272,7 @@ export function ProjectCreationModal({ open, onOpenChange, workspace }: ProjectC
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
</>,
|
||||
document.body
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user