Skip to content

fix(tabs): keep tabs in place when one is selected - #4922

Merged
thetaPC merged 1 commit into
mainfrom
tabs-shift
Dec 2, 2026
Merged

thetaPC merged 1 commit into
mainfrom
tabs-shift

Conversation

@thetaPC

@thetaPC thetaPC commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Selecting a docs tab makes its label bold, which widens it and pushes the tabs after it sideways. The framework tabs already avoid this by reserving the bold width from a data-text attribute. Docusaurus's tabs never had one.

  • A Tabs wrapper in src/theme gives each tab data-text, from values or the TabItem children, whichever the page uses.

Visible change: unselected tabs are a few pixels wider, so nothing moves when one is selected.

How to test

  1. Open Dark Mode. Its tabs have the longest labels, so the shift is easiest to see.
  2. Click back and forth between Always and Class while watching the right edge of the tab group. Nothing moves.
  3. Repeat on production: the tabs after the selected one jump a few pixels.

@vercel

vercel Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ionic-docs Ready Ready Preview Dec 2, 2026 12:29am UTC

Request Review

@thetaPC
thetaPC marked this pull request as ready for review December 2, 2026 00:57
@thetaPC
thetaPC requested a review from a team as a code owner December 2, 2026 00:57
@thetaPC
thetaPC requested a review from brandyscarney December 2, 2026 00:57

@brandyscarney brandyscarney left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@thetaPC
thetaPC merged commit 3dd8a08 into main Dec 2, 2026
7 checks passed
@thetaPC
thetaPC deleted the tabs-shift branch December 2, 2026 22:24

This branch was successfully deployed

1 active deployment
Preview — 189bc89d Deployed Dec 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants