From 868015f344ad23b60784e619e3fba202d61a1cd7 Mon Sep 17 00:00:00 2001 From: Michael Czechowski Date: Tue, 20 May 2025 18:29:40 +0200 Subject: [PATCH] fix: update scroll behavior for lesson navigation and adjust lesson description width for better scrolling --- src/helpers/renderer.js | 4 +++- src/main.css | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/helpers/renderer.js b/src/helpers/renderer.js index c24ff08..dee9045 100644 --- a/src/helpers/renderer.js +++ b/src/helpers/renderer.js @@ -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" }); } } diff --git a/src/main.css b/src/main.css index 372db03..e147cca 100644 --- a/src/main.css +++ b/src/main.css @@ -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);