Skip to content

Commit

Permalink
Add instant behavior to synced tab scrolling (#2747)
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
  • Loading branch information
bbag and delucis authored Jan 6, 2025
1 parent 5b7f611 commit 474c27e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/chilly-paws-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@astrojs/starlight": patch
---

Ensures `<Tab>` component toggling is stable when smooth scrolling is enabled via custom CSS
1 change: 1 addition & 0 deletions packages/starlight/user-components/Tabs.astro
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ if (isSynced) {
StarlightTabs.#syncTabs(this, newTab);
window.scrollTo({
top: window.scrollY + (this.getBoundingClientRect().top - previousTabsOffset),
behavior: 'instant',
});
}
}
Expand Down

0 comments on commit 474c27e

Please sign in to comment.