Skip to content

Commit d698b42

Browse files
committed
fix: update scroll behavior for lesson navigation and adjust lesson description width for better scrolling
1 parent a606011 commit d698b42

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/helpers/renderer.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,9 @@ export function updateActiveLessonInSidebar(moduleId, lessonIndex) {
235235
}
236236
}
237237

238-
// Scroll to ensure the item is visible
238+
// Scroll to the top of the page
239+
document.querySelector("html").scrollTop = 0;
240+
// Scroll to the current lesson item
239241
currentLessonItem.scrollIntoView({ behavior: "smooth", block: "nearest" });
240242
}
241243
}

src/main.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ code {
332332

333333
.lesson-description pre {
334334
display: inline-block;
335+
width: 100%;
335336
font-family: var(--font-code);
336337
font-size: 0.9rem;
337338
background-color: var(--code-bg);

0 commit comments

Comments
 (0)