diff --git a/layout/_macro/sidebar.njk b/layout/_macro/sidebar.njk
index 6730a31..bcf62ce 100644
--- a/layout/_macro/sidebar.njk
+++ b/layout/_macro/sidebar.njk
@@ -22,19 +22,21 @@
-
-
-
+
{%- if theme.back2top.enable and theme.back2top.sidebar %}
diff --git a/source/css/_common/outline/sidebar/sidebar-nav.styl b/source/css/_common/outline/sidebar/sidebar-nav.styl
index eb70483..aa2c820 100644
--- a/source/css/_common/outline/sidebar/sidebar-nav.styl
+++ b/source/css/_common/outline/sidebar/sidebar-nav.styl
@@ -35,13 +35,16 @@
}
}
-.sidebar-panel {
- display: none;
+.sidebar-panel-container {
max-height: var(--sidebar-wrapper-height);
overflow-x: hidden;
overflow-y: auto;
}
+.sidebar-panel {
+ display: none;
+}
+
.sidebar-overview-active .site-overview-wrap {
// Flexbox layout makes it possible to reorder the child
// elements of .site-overview-item through the `order` CSS property
diff --git a/source/js/utils.js b/source/js/utils.js
index 3f3cb42..94589df 100644
--- a/source/js/utils.js
+++ b/source/js/utils.js
@@ -272,7 +272,7 @@ NexT.utils = {
parent = parent.parentNode;
}
// Scrolling to center active TOC element if TOC content is taller then viewport.
- const tocElement = document.querySelector('.post-toc-wrap');
+ const tocElement = document.querySelector('.sidebar-panel-container');
window.anime({
targets : tocElement,
duration : 200,