From 00592c5981ca00a7f0c82326c26b46386f407222 Mon Sep 17 00:00:00 2001 From: Luka Date: Thu, 30 Jan 2025 18:45:37 +0100 Subject: [PATCH] fixed book a call scroll to botom --- apps/website/src/components/Services.astro | 4 +++- apps/website/src/components/navigation.astro | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/website/src/components/Services.astro b/apps/website/src/components/Services.astro index 92a22357..84674094 100644 --- a/apps/website/src/components/Services.astro +++ b/apps/website/src/components/Services.astro @@ -186,7 +186,9 @@ for (const service of servicesCollection) { } if (fromTop > endAt + 200 && i === cards.length - 1) { - endDiv.scrollIntoView({ behavior: "smooth" }); + if (!window.navScroll) { + endDiv.scrollIntoView({ behavior: "smooth" }); + } } }); } else { diff --git a/apps/website/src/components/navigation.astro b/apps/website/src/components/navigation.astro index f6f501c0..26fbcaf0 100644 --- a/apps/website/src/components/navigation.astro +++ b/apps/website/src/components/navigation.astro @@ -175,6 +175,11 @@ function handleBookACall() { navMenuToggle.checked = false; + window.navScroll = true; + + setTimeout(() => { + window.navScroll = false; + }, 1500); } window.addEventListener("scroll", onScroll, { passive: true });