Skip to content

Commit f102654

Browse files
committed
fix sidebar not auto-scrolling on api page
1 parent 2c5d68d commit f102654

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

themes/vue/source/js/common.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,9 @@
202202
if (previousActive) previousActive.classList.remove('active')
203203
currentActive.classList.add('active')
204204
if (shouldScrollIntoView) {
205-
var currentPageOffset = currentPageAnchor.offsetTop - 8
205+
var currentPageOffset = currentPageAnchor
206+
? currentPageAnchor.offsetTop - 8
207+
: 0
206208
var currentActiveOffset = currentActive.offsetTop + currentActive.parentNode.clientHeight
207209
var sidebarHeight = sidebar.clientHeight
208210
var currentActiveIsInView = (

0 commit comments

Comments
 (0)