We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd3e3dd commit dd8410bCopy full SHA for dd8410b
assets/js/sidebar-v2.js
@@ -38,10 +38,10 @@ document.addEventListener('click', (e) => {
38
});
39
40
document.addEventListener('DOMContentLoaded', () => {
41
- const currentPage = window.location.href;
42
- const match = Array.from(document.querySelectorAll('.sidebar__link')).find(
43
- (el) => el.href.includes(currentPage)
44
- );
+ const currentPage = window.location.pathname;
+ const match = Array.from(
+ document.querySelectorAll('.sidebar__link--current')
+ ).find((el) => el?.id?.includes(currentPage));
45
46
if (match) match.scrollIntoView({ behavior: 'instant', block: 'start' });
47
0 commit comments