From 474c27e28d79794ac78d36e3384f0c0da6f2dfed Mon Sep 17 00:00:00 2001 From: Billy Baggerman Date: Mon, 6 Jan 2025 14:42:21 -0500 Subject: Add instant behavior to synced tab scrolling (#2747) Co-authored-by: Chris Swithinbank --- .changeset/chilly-paws-smell.md | 5 +++++ packages/starlight/user-components/Tabs.astro | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changeset/chilly-paws-smell.md diff --git a/.changeset/chilly-paws-smell.md b/.changeset/chilly-paws-smell.md new file mode 100644 index 00000000..a7f3ea20 --- /dev/null +++ b/.changeset/chilly-paws-smell.md @@ -0,0 +1,5 @@ +--- +"@astrojs/starlight": patch +--- + +Ensures `` component toggling is stable when smooth scrolling is enabled via custom CSS diff --git a/packages/starlight/user-components/Tabs.astro b/packages/starlight/user-components/Tabs.astro index 4234eb01..257174e1 100644 --- a/packages/starlight/user-components/Tabs.astro +++ b/packages/starlight/user-components/Tabs.astro @@ -224,6 +224,7 @@ if (isSynced) { StarlightTabs.#syncTabs(this, newTab); window.scrollTo({ top: window.scrollY + (this.getBoundingClientRect().top - previousTabsOffset), + behavior: 'instant', }); } } -- cgit