From 1654191f87aa1a1ddee564b4f02d9c7cc5fe56eb Mon Sep 17 00:00:00 2001 From: Ash Keel Date: Wed, 1 Mar 2023 14:21:07 +0100 Subject: [PATCH] fix toc glitch --- static/script/toc.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/static/script/toc.js b/static/script/toc.js index 4a16e6d..ab73e55 100644 --- a/static/script/toc.js +++ b/static/script/toc.js @@ -18,7 +18,9 @@ if (toc) { (i) => getId(i.target) && i.intersectionRatio > 0 ); if (filtered.length > 0) { - toc.querySelector(`li.active`)?.classList.remove("active"); + toc + .querySelectorAll(`li.active`) + .forEach((entry) => entry.classList.remove("active")); filtered.forEach((entry) => { const id = getId(entry.target); toc