diff --git a/quartz/components/scripts/explorer.inline.ts b/quartz/components/scripts/explorer.inline.ts index 9c8341169..c9f55f867 100644 --- a/quartz/components/scripts/explorer.inline.ts +++ b/quartz/components/scripts/explorer.inline.ts @@ -222,9 +222,9 @@ async function setupExplorer(currentSlug: FullSlug) { explorerUl.scrollTop = parseInt(scrollTop) } else { // try to scroll to the active element if it exists - const activeElement = explorerUl.querySelector(".active") + const activeElement = explorerUl.querySelector(".active") as HTMLElement | null if (activeElement) { - activeElement.scrollIntoView({ behavior: "smooth" }) + explorerUl.scrollTop = activeElement.offsetTop } }