mirror of
https://github.com/DerTyp7/dertyp7.github.io.git
synced 2025-10-30 21:27:09 +01:00
Update SectionScroll behavior
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user