Skip to content

Commit 122486b

Browse files
committed
comment
1 parent 6dddb36 commit 122486b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/pydata_sphinx_theme/assets/scripts/pydata-sphinx-theme.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,6 +1049,10 @@ function setupArticleTocSyncing() {
10491049
// the change event (because it's the same hash), but we still want to re-sync
10501050
// the table of contents.
10511051
window.addEventListener("click", (event) => {
1052+
// Match any link because an in-page ("hash link") can occur anywhere on the
1053+
// page (e.g., one section of the page linking to another section of the
1054+
// page, also each of the headings contains a link to itself), not just in
1055+
// the side table of contents.
10521056
if (event.target.closest("a")) {
10531057
// Defer the sync operation because window.location.hash does not change
10541058
// until after the default action (i.e., the link click) for the event has

0 commit comments

Comments
 (0)