Skip to content

feat(theme-classic): make first tab the default tab - #5647

Merged
slorber merged 3 commits into
meta:mainfrom
Josh-Cena:tab-default
Oct 7, 2021
Merged

slorber merged 3 commits into
meta:mainfrom
Josh-Cena:tab-default

Conversation

@Josh-Cena

@Josh-Cena Josh-Cena commented Oct 5, 2021 •

Copy link
Copy Markdown
Collaborator

Motivation

It's quite weird UX to display no tabs if no default has been provided—how many users would want only headings with no content anyways? (This behavior is still achievable with <Tabs defaultValue="none">)

A further fix I can think of is to throw an error when defaultValue is non-existent, and use defaultValue={null} to specially indicate no tabs open by default. This helps to catch typos early. But that could be a minor BC. (The current fix is already a minor behavior inconsistency, but probably with little effect)

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Updated all the tabs usage on the website.

@netlify

netlify Bot commented Oct 5, 2021 •

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Oct 5, 2021 •

Copy link
Copy Markdown

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟢 Performance 91
🟢 Accessibility 98
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-5647--docusaurus-2.netlify.app/

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Oct 5, 2021
@slorber slorber changed the title feat(theme-classic): make first tab the default default tab feat(theme-classic): make first tab the default tab Oct 7, 2021
@slorber slorber added the pr: bug fix This PR fixes a bug in a past release. label Oct 7, 2021
@slorber

slorber commented Oct 7, 2021

Copy link
Copy Markdown
Collaborator

Thanks, also noticed that weird behavior 👍

A further fix I can think of is to throw an error when defaultValue is non-existent, and use defaultValue={null} to specially indicate no tabs open by default. This helps to catch typos early. But that could be a minor BC. (The current fix is already a minor behavior inconsistency, but probably with little effect)

Totally agree with this breaking change, we want to fail fast here and prevent user mistakes

@slorber
slorber merged commit d6b4eeb into meta:main Oct 7, 2021
@Josh-Cena
Josh-Cena deleted the tab-default branch October 8, 2021 11:44
mrizwanashiq pushed a commit to mrizwanashiq/docusaurus that referenced this pull request Jun 25, 2026
* Initial work

* Little doc fix

* Doc fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants