Skip to content

Commit

Permalink
fix: sidebar without active elements (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
mogottsch committed Nov 17, 2023
1 parent 9a0624b commit 09589af
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/assets/static/js/components/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,11 @@ class Sidebar {

// Scroll into active sidebar
setTimeout(() => {
this.forceElementVisibility(document.querySelector(".sidebar-item.active"))
}, 300)
const activeSidebarItem = document.querySelector(".sidebar-item.active");
if (activeSidebarItem) {
this.forceElementVisibility(activeSidebarItem);
}
}, 300);


if (this.options.recalculateHeight) {
Expand Down

0 comments on commit 09589af

Please sign in to comment.