From ac7f16b7c48ddb228ca9f4beb88e53a28f08cc74 Mon Sep 17 00:00:00 2001 From: Aryaman1792 Date: Mon, 10 Nov 2025 22:14:59 +0530 Subject: [PATCH] Fix calculation of targetTop in router.ts --- src/client/app/router.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/app/router.ts b/src/client/app/router.ts index de7fe261f2d9..777c6297a5ad 100644 --- a/src/client/app/router.ts +++ b/src/client/app/router.ts @@ -269,11 +269,11 @@ export function scrollTo(hash: string, smooth = false, scrollPosition = 0) { } if (!target) return - const targetTop = + const targetTop ={ window.scrollY + target.getBoundingClientRect().top - getScrollOffset() + - Number.parseInt(window.getComputedStyle(target).paddingTop, 10) || 0 + Number.parseInt(window.getComputedStyle(target).paddingTop, 10) }|| 0 const behavior = window.matchMedia('(prefers-reduced-motion)').matches ? 'instant'