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

You just killed the accessibility! #434

Closed
DimaGashko opened this issue Jul 18, 2019 · 3 comments
Closed

You just killed the accessibility! #434

DimaGashko opened this issue Jul 18, 2019 · 3 comments

Comments

@DimaGashko
Copy link
Contributor

DimaGashko commented Jul 18, 2019

Issue description: I've no idea why you add the "tabindex" attribute to everything. It's too bad! You just killed keyboard navigation...

@coreymcollins
Copy link

We've been looking at working Tiny Slider into our WordPress starter theme at WebDevStudios. One of the pain points of a lot of carousels we've tested is accessibility and the issue with trying to tab through a site and not break or get stuck in a carousel.

We had the same issue you and others noted where tabbing through slides with links/buttons in them just kind of broke everything visually.

In this update in a yet-to-be-reviewed PR (WebDevStudios/wd_s#481 (comment)) I've added some JS to do the following:

  1. On load, all slides have their anchor tags and buttons set to tabindex=-1
  2. Also on load, any anchor tags and buttons inside of the initial slide are set to tabindex=0 so they can be naturally tabbed to
  3. On slide change, all other slides have their anchor tags and buttons set to tabindex=-1
  4. Also on slide change, the new current slide has its anchor tags and buttons set to tabindex=0 so they are tab-able

It's a first pass so it can likely be cleaned up and I want to do some stress testing, but in my tests thus far it's allowing me to tab through ONLY the active slide and not get caught up in the never-ending tab madness. It sets the links/buttons in inactive slides to tabindex=-1 so they never get picked up when tabbing, and they only become keyboard accessible/available when their parent slide is active.

Wanted to share it as it sounds like we were fighting the same issue and I thought it might be of some help to you and others!

@ganlanyuan
Copy link
Owner

Check out #4
tabindex="-1" was added so that user doesn't necessarily Tab through all the dots and controls in order to get the right one.
I was referring to http://mmckinnon.com/blog/2015/accessible-carousels-part-2.

@DimaGashko
Copy link
Contributor Author

@ganlanyuan yeah you're right. I was tricked by focus: none on my project.

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

No branches or pull requests

3 participants