From 0de5c8d60d49d6ea5b82fcb4f468c275667d570e Mon Sep 17 00:00:00 2001 From: dertyp7 Date: Sun, 14 Jan 2024 13:09:03 +0100 Subject: [PATCH] Update SectionScroll behavior --- src/App.tsx | 2 +- src/components/SectionScroll.tsx | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index bf03175..c8c0d4b 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -68,7 +68,7 @@ export default function App() {

Website under construction 🚧👷

- + ); } diff --git a/src/components/SectionScroll.tsx b/src/components/SectionScroll.tsx index 7cbbb1d..cb6df80 100644 --- a/src/components/SectionScroll.tsx +++ b/src/components/SectionScroll.tsx @@ -25,11 +25,7 @@ export default function SectionScroll({ sections }: { sections: string[] }) { if (newIndex < 0) newIndex = sections.length - 1; if (newIndex >= sections.length) newIndex = 0; - const sectionElement = document.getElementById(sections[newIndex]); - if (sectionElement) { - sectionElement.scrollIntoView({ behavior: "smooth" }); - } - + window.location.hash = sections[newIndex]; setCurrentSectionIndex(newIndex); }