diff --git a/src/client/theme-default/composables/outline.ts b/src/client/theme-default/composables/outline.ts index 666896ebf53d..b4c9fb4af3d4 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)}"]` )