fix: update scroll behavior for lesson navigation and adjust lesson description width for better scrolling

This commit is contained in:
Michael Czechowski
2025-05-20 18:29:40 +02:00
parent a606011c9a
commit d698b42b10
2 changed files with 4 additions and 1 deletions

View File

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

View File

@@ -332,6 +332,7 @@ code {
.lesson-description pre {
display: inline-block;
width: 100%;
font-family: var(--font-code);
font-size: 0.9rem;
background-color: var(--code-bg);