Skip to content

Commit dddfae5

Browse files
committed
fix: scroll api sidebar on load
1 parent 1272d93 commit dddfae5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

apify-docs-theme/static/js/custom.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,8 @@ document.addEventListener('scroll', () => {
7474
ticking = true;
7575
}
7676
});
77+
78+
document.addEventListener('DOMContentLoaded', () => {
79+
// we need to wait a bit more, since the event fires too soon, and a lot of hydration is done after it
80+
setTimeout(() => scrollSidebarItemIntoView(), 3000);
81+
});

0 commit comments

Comments
 (0)