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

Document why tabindex is necessary when a11y: true #60

Closed
julkue opened this issue Aug 4, 2017 · 4 comments
Closed

Document why tabindex is necessary when a11y: true #60

julkue opened this issue Aug 4, 2017 · 4 comments
Labels

Comments

@julkue
Copy link

julkue commented Aug 4, 2017

This would be helpful I think.

@callmecavs
Copy link
Owner

happy to look at a PR that adds this documentation to the a11y section of the README.

the reason is here on MDN. quoting that page:

A negative value (usually tabindex="-1") means that the element should be focusable, but should not be reachable via sequential keyboard navigation. Mostly useful to create accessible widgets with JavaScript.

more context from @Heydon on #16

@callmecavs callmecavs added the docs label Aug 4, 2017
@julkue
Copy link
Author

julkue commented Aug 4, 2017

I do understand the meaning of tabindex, but I don't understand why a section you've just scrolled to shouldn't be reachable by keyboard navigation?

@julkue
Copy link
Author

julkue commented Aug 4, 2017

However, when I have time I will read through the issue you've posted.

@callmecavs
Copy link
Owner

callmecavs commented Aug 4, 2017

@julmot as I understand it, tabindex of -1 programmatically forces the focus. you can still apply a tabindex to the element - it'll just be overridden to force focus when that element is jumped to

@Heydon does a nice job of painting the full picture in that other issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants