Skip to content

Commit f048b3f

Browse files
amide-initclaude
andcommitted
fix: render preview modal via React portal to escape navbar stacking context
The navbar uses backdrop-blur-md which creates a CSS stacking context. Any position:fixed child is clipped to that context instead of the viewport, making the modal invisible. Using createPortal to mount the modal directly on document.body ensures it always renders above everything regardless of ancestor transforms or filters. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c7df5e6 commit f048b3f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/components/PortfolioPreviewModal.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { useEffect, useRef } from 'react'
2+
import { createPortal } from 'react-dom'
23
import { X, Star, MapPin, Globe, ExternalLink, GitFork, Users, BookOpen } from 'lucide-react'
34

45
// Twitter/X brand icon (lucide-react does not ship it)
@@ -164,7 +165,7 @@ export function PortfolioPreviewModal({ user, repos, onClose }: Props) {
164165
? user.blog.startsWith('http') ? user.blog : `https://${user.blog}`
165166
: null
166167

167-
return (
168+
return createPortal(
168169
<div
169170
className="fixed inset-0 z-[200] flex flex-col bg-black/70 backdrop-blur-sm"
170171
role="dialog"
@@ -366,6 +367,7 @@ export function PortfolioPreviewModal({ user, repos, onClose }: Props) {
366367
</section>
367368

368369
</div>
369-
</div>
370+
</div>,
371+
document.body
370372
)
371373
}

0 commit comments

Comments
 (0)