Close lightboxes/overlays on tab switch

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Scott Reimers 2026-03-22 23:30:14 -04:00
parent 6320a82852
commit 6aad2e073c

View file

@ -2818,6 +2818,8 @@ circleNameInput.addEventListener('keydown', (e) => {
document.querySelectorAll('.tab').forEach(tab => {
tab.addEventListener('click', () => {
if (tab.dataset.tab === currentTab) return;
// Close any open lightboxes/overlays/popovers
document.querySelectorAll('.image-lightbox, .download-prompt-overlay, .offline-lightbox, .overlay').forEach(el => el.remove());
document.querySelectorAll('.tab').forEach(t => t.classList.remove('active'));
const oldView = document.querySelector('.view.active');
if (oldView) {