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];