From 53425c26c8d26a22e06787bdc676c057903cab07 Mon Sep 17 00:00:00 2001 From: Manojava Koushik <111366021+manojava-gk@users.noreply.github.com> Date: Wed, 12 Jul 2023 19:42:46 +0530 Subject: [PATCH] bugfix(static page): fix inline scroll height (#123) --- .../Cards/TitleDescriptionAndSectionlink.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/shared/templates/StaticTemplateResponsive/Cards/TitleDescriptionAndSectionlink.tsx b/src/components/shared/templates/StaticTemplateResponsive/Cards/TitleDescriptionAndSectionlink.tsx index cd40ec956..a6c71da87 100644 --- a/src/components/shared/templates/StaticTemplateResponsive/Cards/TitleDescriptionAndSectionlink.tsx +++ b/src/components/shared/templates/StaticTemplateResponsive/Cards/TitleDescriptionAndSectionlink.tsx @@ -37,9 +37,9 @@ export default function TitleDescriptionAndSectionlink({ const navigateTo = (link: { internal: boolean; id: string }) => { if (link.internal) { const element = document.getElementById(link.id) - const top = element?.offsetTop + const top = element && element.offsetTop - 200 window.scrollTo({ - top: top, + top: top ?? 0, behavior: 'smooth', }) } else {