From 81e7405e193e832442db9aedb50ed3dc741e92ed Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Mon, 7 Aug 2023 13:02:46 +0530 Subject: [PATCH] fix(theme): hide outline marker on scroll to top --- src/client/theme-default/composables/outline.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client/theme-default/composables/outline.ts b/src/client/theme-default/composables/outline.ts index 666896eb..b4c9fb4a 100644 --- a/src/client/theme-default/composables/outline.ts +++ b/src/client/theme-default/composables/outline.ts @@ -168,7 +168,9 @@ export function useActiveAnchor( prevActiveLink.classList.remove('active') } - if (hash !== null) { + if (hash == null) { + prevActiveLink = null + } else { prevActiveLink = container.value.querySelector( `a[href="${decodeURIComponent(hash)}"]` )