🐛 Bug Report
useButton doesn't forward the tabIndex prop.
🤔 Expected Behavior
useButton returns a tabIndex when passed to it as a parameter.
😯 Current Behavior
useButton does not return a tabIndex when passed to it as a parameter.
💁 Possible Solution
https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/button/src/useButton.ts
It looks like tabIndex is excluded if the elementType is the default "button". By my current understanding, this shouldn't be the case (https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex).
🔦 Context
I'm treating tabIndex as a special case in my Button component, which is simple enough, but it would be nice if I and others didn't have to (or debug the issue in the first place).
💻 Code Sample
https://codesandbox.io/s/polished-dust-0k2d1?file=/src/App.js
🌍 Your Environment
| Software |
Version(s) |
| react-aria |
3.12.0 |
| Browser |
Chrome 97.0.4692.99 |
| Operating System |
MacOs 11.6.4 |
🐛 Bug Report
useButton doesn't forward the tabIndex prop.
🤔 Expected Behavior
useButton returns a tabIndex when passed to it as a parameter.
😯 Current Behavior
useButton does not return a tabIndex when passed to it as a parameter.
💁 Possible Solution
https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/button/src/useButton.ts
It looks like tabIndex is excluded if the elementType is the default "button". By my current understanding, this shouldn't be the case (https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex).
🔦 Context
I'm treating tabIndex as a special case in my Button component, which is simple enough, but it would be nice if I and others didn't have to (or debug the issue in the first place).
💻 Code Sample
https://codesandbox.io/s/polished-dust-0k2d1?file=/src/App.js
🌍 Your Environment