Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Oct 7, 2021

Conversation

Josh-Cena
Copy link
Collaborator

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

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
Copy link

netlify bot commented Oct 5, 2021

✔️ [V2]
Built without sensitive environment variables

🔨 Explore the source changes: d69cf08

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/615c13f38ae66400077be4ef

😎 Browse the preview: https://deploy-preview-5647--docusaurus-2.netlify.app

@github-actions
Copy link

github-actions bot commented Oct 5, 2021

⚡️ 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
Copy link
Collaborator

slorber commented Oct 7, 2021

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

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.

None yet

3 participants