diff options
author | Billy Baggerman | 2025-01-06 14:42:21 -0500 |
---|---|---|
committer | GitHub | 2025-01-06 20:42:21 +0100 |
commit | 474c27e28d79794ac78d36e3384f0c0da6f2dfed (patch) | |
tree | 52513e3e5996efe6d9bcff9b4928f22497b6c0d5 | |
parent | 5b7f61109e9640730acb28d62a85574c4138046c (diff) | |
download | IT.starlight-474c27e28d79794ac78d36e3384f0c0da6f2dfed.tar.gz IT.starlight-474c27e28d79794ac78d36e3384f0c0da6f2dfed.tar.bz2 IT.starlight-474c27e28d79794ac78d36e3384f0c0da6f2dfed.zip |
Add instant behavior to synced tab scrolling (#2747)
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
-rw-r--r-- | .changeset/chilly-paws-smell.md | 5 | ||||
-rw-r--r-- | packages/starlight/user-components/Tabs.astro | 1 |
2 files changed, 6 insertions, 0 deletions
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 `<Tab>` 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', }); } } |