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 {