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

Excluded body from getting tabIndex #2468

Closed
wants to merge 1 commit into from
Closed

Conversation

s77rt
Copy link
Contributor

@s77rt s77rt commented Jan 17, 2023

The goal of this PR is to exclude <body> from having the tabIndex attribute added for the following reasons:

  1. It messes up with modal accessibility, as if you open a modal with <body> having tabIndex="-1" you won't be able to select any text on that modal.
  2. It's unnecessary, although body is not really a focusable element, it's pretty much treated as if it is (source)
  3. There is no case where adding tabIndex to body is something that the user would want / expect

Alternative solution:
After setting focus to the element, remove the added tabIndex attribute. But I think this is only a complementary solution as excluding body still seems required.

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@s77rt
Copy link
Contributor Author

s77rt commented Jan 25, 2023

@necolas Would you mind take a quick look on this PR?

@necolas necolas added this to the 0.18.x milestone Jan 25, 2023
@necolas necolas closed this in 77f6fba Jan 25, 2023
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.

2 participants