-
Notifications
You must be signed in to change notification settings - Fork 250
Document body should be a focusable element #365
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
Comments
Possibly related: Looks like we need to integrate Update: I think perhaps this might be intended. I was using
|
Hi @juanca I think that body is not in the list of focusable elements |
Whenever I press tab past the end of the document (both on Mac and Windows, and without any focus traps), The MDN documentation on
However, I'm also not sure how we should handle continuing to tab past the end of the document when there's no focus trap. Should we add an arbitrary number of fake buttons, loop back around immediately, or error because the functionality is undefined outside of a browser? |
@nickmccurdy I appreciate the analysis and clarification. I think you're 100% right.
My latest train of thought: I think it is sensible to simulate a single active element outside the page tab sequence.
Suggested theoretical solution:
Outside of scope:
Whaddya'll think? |
That sounds good. Maybe we should just leave |
🎉 This issue has been resolved in version 12.0.3 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
@testing-library/user-event
version:@testing-library/[email protected]
[email protected]
[email protected]
node/10.20.1
Relevant code or config (I'm also using React)
What you did:
Ran the test.
What happened:
The test failed.
Reproduction repository:
Problem description:
It looks like the
tab
method does not consider the body as a tabable element. That is actually not true -- at least from doing a quick experiment in Chrome.The following screenshot is the experiement.
Suggested solution:
Assuming the focus trap is on the document, always set the body as the first tabable element.
The text was updated successfully, but these errors were encountered: