Skip to content

Commit 8a11d14

Browse files
KyleJShaverulivz
authored andcommitted
fix($plugin-active-header-links): side navigation edge case bug (#1477)
1 parent d34e038 commit 8a11d14

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/@vuepress/plugin-active-header-links/clientRootMixin.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ export default {
4040

4141
const routeHash = decodeURIComponent(this.$route.hash)
4242
if (isActive && routeHash !== decodeURIComponent(anchor.hash)) {
43-
let activeAnchor = anchor
43+
const activeAnchor = anchor
4444
// check if anchor is at the bottom of the page to keep $route.hash consistent
4545
if (bottomY === scrollHeight) {
4646
for (let j = i + 1; j < anchors.length; j++) {
4747
if (routeHash === decodeURIComponent(anchors[j].hash)) {
48-
activeAnchor = anchors[j]
48+
return
4949
}
5050
}
5151
}

0 commit comments

Comments
 (0)