From 0ff447912b6ef0db33a6aa3bb79adfca461295c1 Mon Sep 17 00:00:00 2001 From: Bobbie Goede Date: Wed, 13 Mar 2024 17:41:05 +0100 Subject: [PATCH] feat: scroll active outline marker into view on activation --- src/client/theme-default/composables/outline.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client/theme-default/composables/outline.ts b/src/client/theme-default/composables/outline.ts index 74e72a0f..46fb2643 100644 --- a/src/client/theme-default/composables/outline.ts +++ b/src/client/theme-default/composables/outline.ts @@ -168,6 +168,7 @@ export function useActiveAnchor( if (activeLink) { activeLink.classList.add('active') + activeLink.scrollIntoView({ behavior: 'smooth', block: 'center' }) marker.value.style.top = activeLink.offsetTop + 39 + 'px' marker.value.style.opacity = '1' } else {