From dddfae5006177d1c1c93f46006ed12b73b688554 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ad=C3=A1mek?= Date: Thu, 14 Nov 2024 14:51:54 +0100 Subject: [PATCH] fix: scroll api sidebar on load --- apify-docs-theme/static/js/custom.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apify-docs-theme/static/js/custom.js b/apify-docs-theme/static/js/custom.js index 38988521dc..0ad86801f2 100644 --- a/apify-docs-theme/static/js/custom.js +++ b/apify-docs-theme/static/js/custom.js @@ -74,3 +74,8 @@ document.addEventListener('scroll', () => { ticking = true; } }); + +document.addEventListener('DOMContentLoaded', () => { + // we need to wait a bit more, since the event fires too soon, and a lot of hydration is done after it + setTimeout(() => scrollSidebarItemIntoView(), 3000); +});