From 61b3015896adc88fbbc3a269c82288a3f66eff2e Mon Sep 17 00:00:00 2001 From: Johann Date: Tue, 9 Jun 2026 19:30:15 +0200 Subject: [PATCH] fix: browser back button closes media overlay instead of navigating --- index.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.php b/index.php index 6b6ae8c..4f2c24c 100644 --- a/index.php +++ b/index.php @@ -1273,6 +1273,11 @@ if (isset($_GET['action'])) { // Browser back/forward window.addEventListener('popstate', (e) => { + // If overlay is open, close it instead of navigating + if (overlay.classList.contains('active')) { + closeOverlay(); + return; + } if (e.state && e.state.path !== undefined) { currentPath = e.state.path; historyStack = [e.state.path];