feat: make sure to scroll to the top when navigating to lesson

This commit is contained in:
Michael Czechowski
2025-05-20 18:49:39 +02:00
parent d698b42b10
commit 6d17801e2f

View File

@@ -237,6 +237,7 @@ export function updateActiveLessonInSidebar(moduleId, lessonIndex) {
// Scroll to the top of the page // Scroll to the top of the page
document.querySelector("html").scrollTop = 0; document.querySelector("html").scrollTop = 0;
document.body.scrollTop = 0;
// Scroll to the current lesson item // Scroll to the current lesson item
currentLessonItem.scrollIntoView({ behavior: "smooth", block: "nearest" }); currentLessonItem.scrollIntoView({ behavior: "smooth", block: "nearest" });
} }