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

Tab without id prop fails accessibility #7511

Closed
1 of 2 tasks
gptt916 opened this issue Jan 6, 2021 · 0 comments · Fixed by #7519
Closed
1 of 2 tasks

Tab without id prop fails accessibility #7511

gptt916 opened this issue Jan 6, 2021 · 0 comments · Fixed by #7519

Comments

@gptt916
Copy link
Contributor

gptt916 commented Jan 6, 2021

What package(s) are you using?

  • carbon-components
  • carbon-components-react

Detailed description

Describe in detail the issue you're having.

The documentation does not mark the id prop as required, however if this prop is not provided then the rendered html will look like this:

<button 
  type="button" 
  role="tab" 
  aria-selected="true" 
  aria-controls="undefined__panel" 
  class="bx--tabs--scrollable__nav-link" 
  href="#" tabindex="0"
>
  asdf
</button>

note the undefined__panel as aria-control

Is this issue related to a specific component?

Tab

What did you expect to happen? What happened instead? What would you like to
see changed?

Either the id prop needs to be marked as required, or if there is no id passed in then use some sort of default id.

What browser are you working in?

Chrome, firefox

What version of the Carbon Design System are you using?

x.25

What offering/product do you work on? Any pressing ship or release dates we
should be aware of?

IBM Cloud Docs

Steps to reproduce the issue

  1. Render Tabs with a Tab element without passing any props
  2. Check html tree

https://codesandbox.io/s/gracious-perlman-3v6iw

Additional information

  • Screenshots or code
  • Notes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants