Skip to content

Commit

Permalink
fix: sidebar scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
pateljannat committed Jun 19, 2024
1 parent 8aee44c commit aedd791
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wiki/public/js/wiki.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ window.Wiki = class Wiki {
let active_sidebar_item = $(".doc-sidebar .sidebar-item.active");
if (active_sidebar_item.length > 0) {
setTimeout(function () {
active_sidebar_item.get(0).scrollIntoView(false);
let position = active_sidebar_item.offset().top - $(".doc-sidebar").offset().top;
$(".doc-sidebar .web-sidebar").get(0).scrollTo(0, position);
}, 50);
}
}
Expand Down

0 comments on commit aedd791

Please sign in to comment.