From 7ea6486f3ff10dca0d47f9f6539cd5228ff0146a Mon Sep 17 00:00:00 2001 From: Carlos Polop Date: Mon, 26 Jan 2026 15:28:31 +0100 Subject: [PATCH] fix expandables on index --- theme/toc.js.hbs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/theme/toc.js.hbs b/theme/toc.js.hbs index 4ddabd81e..b708e3949 100644 --- a/theme/toc.js.hbs +++ b/theme/toc.js.hbs @@ -35,10 +35,8 @@ class MDBookSidebarScrollbox extends HTMLElement { parent.classList.add("expanded"); } while (parent) { - if (parent.tagName === "LI" && parent.previousElementSibling) { - if (parent.previousElementSibling.classList.contains("chapter-item")) { - parent.previousElementSibling.classList.add("expanded"); - } + if (parent.tagName === "LI" && parent.classList.contains("chapter-item")) { + parent.classList.add("expanded"); } parent = parent.parentElement; }