From: James Addison <jay@jp-hosting.net>
Date: Sat, 18 Jan 2025 20:34:48 +0300
Subject: Attach sidebar-close handler to current-page links

Bug-Debian: http://bugs.debian.org/1075914
Forwarded: https://github.com/readthedocs/sphinx_rtd_theme/pull/1588
---
 src/theme.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/theme.js b/src/theme.js
index db546b4..106c7a0 100644
--- a/src/theme.js
+++ b/src/theme.js
@@ -86,7 +86,7 @@ function ThemeNav () {
             })
 
             // Nav menu link click operations
-            .on('click', ".wy-menu-vertical .current ul li a", function() {
+            .on('click', ".wy-menu-vertical ul li a[href^='#']", function() {
                 var target = $(this);
                 // Close menu when you click a link.
                 $("[data-toggle='wy-nav-shift']").removeClass("shift");
