[button] Unnecessary to always have `tabindex=0`
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 99.1k
- Forks
- 32.5k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 106
Description
- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
Following code
<Button variant="contained">Contained</Button>
renders

Expected Behavior 🤔
If tabIndex is not provided to component Button, it is unnecessary to render tabindex=0 in result html since button is tab-able by default, unless a number is provided to Button as parameter.
Steps to Reproduce 🕹
Steps:
- go to https://mui.com/components/buttons/
- inspect button from one of example
Context 🔦
Accessibility
Your Environment 🌎
Chrome browser
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Button component used by the examples at https://mui.com/components/buttons/ and inspect the rendered HTML for a button without an explicit tabIndex. Check the existing Button tests or accessibility coverage, then verify that tabindex="0" is omitted when tabIndex is absent but preserved when a numeric value is provided.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- accessibility, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100