Skip to content

Fix Tabs with every key disabled#3162

Merged
snowystinger merged 4 commits intomainfrom
tabs-all-disabled-keys
May 26, 2022
Merged

Fix Tabs with every key disabled#3162
snowystinger merged 4 commits intomainfrom
tabs-all-disabled-keys

Conversation

@snowystinger
Copy link
Copy Markdown
Member

@snowystinger snowystinger commented May 25, 2022

Closes

Found in testing session
One outstanding question, should we select anything if all tabs are disabled? should it display anything in the tab panel? This PR gets us back to the state we had before which was yes to both of those questions, but I don't feel like we adequately considered this back when we implemented it.

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

Load up the story /story/tabs--all-disabled
it should render, the first tab should be selected, focus should go immediately to the tab panel

unit tests should cover the cases

🧢 Your Project:

@adobe-bot
Copy link
Copy Markdown

Copy link
Copy Markdown
Member

@reidbarber reidbarber left a comment

Choose a reason for hiding this comment

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

should we select anything if all tabs are disabled? should it display anything in the tab panel?

Since a disabled tab can be in a selected state (via controlled or default), I think this is fine.

Copy link
Copy Markdown
Member

@LFDanLu LFDanLu left a comment

Choose a reason for hiding this comment

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

LGTM, I agree, we should default to selecting the first tab even if it is disabled if all other are disabled. If someone doesn't want to render the TabPanel contents or the Tabs at all for this case, they can do so manually

@adobe-bot
Copy link
Copy Markdown

@adobe-bot
Copy link
Copy Markdown

@snowystinger snowystinger merged commit c018fff into main May 26, 2022
@snowystinger snowystinger deleted the tabs-all-disabled-keys branch May 26, 2022 17:33
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.

4 participants