diff --git a/frontend/app.js b/frontend/app.js index bf16e44..92b150c 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -2043,9 +2043,10 @@ document.addEventListener('click', async (e) => { // --- Video expand/collapse (double-click to toggle fullscreen-like view) --- // --- Image lightbox (click to open full-size popup) --- document.addEventListener('click', (e) => { - // Close lightbox on click - const lb = e.target.closest('.image-lightbox'); - if (lb) { lb.remove(); return; } + // Close lightbox on click — overlay background or image inside it (not form content) + if (e.target.classList.contains('image-lightbox')) { e.target.remove(); return; } + const lbParent = e.target.closest('.image-lightbox'); + if (lbParent && e.target.tagName === 'IMG') { lbParent.remove(); return; } const img = e.target.closest('img.post-image'); if (!img) return;