fix toc glitch

This commit is contained in:
Ash Keel 2023-03-01 14:21:07 +01:00
parent a0fc21db39
commit 1654191f87
No known key found for this signature in database
GPG Key ID: BAD8D93E7314ED3E
1 changed files with 3 additions and 1 deletions

View File

@ -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