Fix lightbox close: only close on overlay/image click, not inner content
The global click handler was removing any .image-lightbox on any click inside it, which broke export/import/identity wizards (clicking radio buttons or text inputs closed the wizard). Now only closes on overlay background click or image click, preserving form interaction. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4379b6fdfc
commit
a349d33422
1 changed files with 4 additions and 3 deletions
|
|
@ -2043,9 +2043,10 @@ document.addEventListener('click', async (e) => {
|
||||||
// --- Video expand/collapse (double-click to toggle fullscreen-like view) ---
|
// --- Video expand/collapse (double-click to toggle fullscreen-like view) ---
|
||||||
// --- Image lightbox (click to open full-size popup) ---
|
// --- Image lightbox (click to open full-size popup) ---
|
||||||
document.addEventListener('click', (e) => {
|
document.addEventListener('click', (e) => {
|
||||||
// Close lightbox on click
|
// Close lightbox on click — overlay background or image inside it (not form content)
|
||||||
const lb = e.target.closest('.image-lightbox');
|
if (e.target.classList.contains('image-lightbox')) { e.target.remove(); return; }
|
||||||
if (lb) { lb.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');
|
const img = e.target.closest('img.post-image');
|
||||||
if (!img) return;
|
if (!img) return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue