From 2b114b6f5e730917c0e449cc6ebd9efe6eb458ea Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 26 May 2026 11:07:35 +0000 Subject: [PATCH] Fix carousel explicit tab selection Co-authored-by: pa7ch3s --- index.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 62f6e91..5446849 100644 --- a/index.html +++ b/index.html @@ -191,6 +191,7 @@

Contact

var reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches; var scrollDebounce = null; var lastScrollIndex = -1; + var suppressProgrammaticScrollSync = false; function indexFromCenter() { if (!carousel) return 0; @@ -251,6 +252,7 @@

Contact

} if (!fromScroll) { + suppressProgrammaticScrollSync = true; scrollTabToCenter(index); } @@ -264,6 +266,10 @@

Contact

if (scrollDebounce) clearTimeout(scrollDebounce); scrollDebounce = setTimeout(function () { scrollDebounce = null; + if (suppressProgrammaticScrollSync) { + suppressProgrammaticScrollSync = false; + return; + } var idx = indexFromCenter(); if (idx === lastScrollIndex) return; setActive(idx, false, true); @@ -314,7 +320,7 @@

Contact

tabs.forEach(function (t, i) { if (t.classList.contains('is-active')) initialIndex = i; }); - setActive(initialIndex, false, false); + setActive(initialIndex, false, true); })();