Skip to content

Impossible to pass tabIndex to Button #9697

@davidalvarezr

Description

@davidalvarezr

Provide a general summary of the issue here

I have a modal component with a close button.

In the DOM, the close button appears before the contente.

I want the close button to be the last focusable element, by passing tabIndex={999}, but the prop is not available.

🤔 Expected Behavior?

I should be able to write this:
<Button tabIndex={999}>Last</Button><Button>First</Button>

😯 Current Behavior

I tried passing tabindex, tabIndex and tab-index but the rendered HTML is always <button tabindex="0">Last</button>

💁 Possible Solution

Make tabIndex prop available

🔦 Context

https://codesandbox.io/p/sandbox/sharp-mirzakhani-zrdjkn

🖥️ Steps to Reproduce

Check codesandbox link

Version

react-aria-components: 1.15.1

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

Windows

🧢 Your Company/Team

react-aria-components

🕷 Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions