Fix lightbox: close when clicking outside the photo itself

Move stopPropagation from the outer container to the image
element only, so clicking dark space around the photo closes
the lightbox.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-02-10 20:29:38 +00:00
parent 82ba5bb21a
commit a44b7848dd
1 changed files with 9 additions and 6 deletions

View File

@ -258,11 +258,11 @@ function GallerySection() {
<line x1="6" y1="6" x2="18" y2="18"/>
</svg>
</button>
<div
className="relative w-full h-full max-w-6xl max-h-[85vh] flex flex-col items-center justify-center"
onClick={(e) => e.stopPropagation()}
>
<div className="relative w-full flex-1 min-h-0">
<div className="relative w-full h-full max-w-6xl max-h-[85vh] flex flex-col items-center justify-center">
<div
className="relative w-full flex-1 min-h-0"
onClick={(e) => e.stopPropagation()}
>
<Image
src={selectedArtwork.src}
alt={selectedArtwork.title}
@ -271,7 +271,10 @@ function GallerySection() {
sizes="(max-width: 768px) 100vw, 90vw"
/>
</div>
<p className="text-white/80 font-sans-alt text-sm tracking-widest mt-4 text-center">
<p
className="text-white/80 font-sans-alt text-sm tracking-widest mt-4 text-center"
onClick={(e) => e.stopPropagation()}
>
{selectedArtwork.title}
</p>
</div>