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

Tabindex issue #32

Closed
bikasv opened this issue Jun 15, 2018 · 11 comments
Closed

Tabindex issue #32

bikasv opened this issue Jun 15, 2018 · 11 comments
Assignees
Labels

Comments

@bikasv
Copy link

bikasv commented Jun 15, 2018

Hi,
Accessibility tools generally freaks when tabindex is greater than 0 and it seems this library is using tabindex 1 in place.
I'm not sure how important is that to have that implementation, but is it possible to run with tabindex 0 only?

@theKashey
Copy link
Owner

Just disable "focus guards" by noFocusGuards - as result FocusLock will not add any nodes with tabIndexes set, but will not work if focus locked node is the first or the last on the page.

@theKashey
Copy link
Owner

And could you elaborate more about Accessibility tools, may be it is better to add a new option, forcing guards not to use positive tabindexes, as long they are needed cos you might have them inside.

@bikasv
Copy link
Author

bikasv commented Jun 17, 2018

noFocusGuard works perfectly.

As for accessibility tools, I've used aXe and Chrome Lighthouse. There are guides over MDN and WAI ARIA which suggests only 2 values of tabindex - 0 and -1.

But for now my issue has been resolved. Thank you.

@bikasv bikasv closed this as completed Jun 17, 2018
@theKashey
Copy link
Owner

Good luck then!

@crshmk
Copy link
Contributor

crshmk commented Nov 29, 2021

I suggest reopening this. Our accessibility team also takes serious issue with the tabIndex of 1.

I believe the issue is here. Is there any reason why this tabIndex cannot be 0 rather than 1? Everything seems to work correctly for me when I set it 0.

@theKashey
Copy link
Owner

guard-nearest is just an extra precaution, which might be helpful if if you positive indexes in other places.
If you don't - then it's completely useless.

Thank for raising this question, it might be a good time to reconsider this moment

Related:

@theKashey theKashey reopened this Nov 29, 2021
@theKashey theKashey self-assigned this Nov 29, 2021
@crshmk
Copy link
Contributor

crshmk commented Nov 30, 2021

#182

@crshmk
Copy link
Contributor

crshmk commented Dec 3, 2021

@theKashey in the above PR, I'm suggesting a couple of api options to get this rolling. If you have a way you'd prefer to do this, feel free to let me know and I'll update as you like.

@TrevorRice
Copy link

Just chiming in that this is something we've run into as well. For context, we've developed a generic trapping component in our design system that leverages react-focus-lock that is used internally within our components and exposed externally for consumers of the system to use directly. While we're able to turn off the jest-axe tabindex rule in our own unit tests, any downstream user of our component would need to as well (assuming they're using some accessibility tool in their tests).

I'll look to see if noFocusGuards would be a suitable workaround for us, but I just wanted to echo support for the suggestion to add an option to use a value of 0 instead of 1.

@theKashey
Copy link
Owner

Not yet released....

@theKashey theKashey reopened this Feb 13, 2022
@theKashey
Copy link
Owner

Update released as version 2.8.0

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

4 participants