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

Active slide has tabindex="-1" #2338

Open
ygatesoupe opened this issue May 26, 2016 · 15 comments
Open

Active slide has tabindex="-1" #2338

ygatesoupe opened this issue May 26, 2016 · 15 comments

Comments

@ygatesoupe
Copy link

ygatesoupe commented May 26, 2016

Active slide should be able to gain focus when tabbing with keyboard, so that its content can be rendered by screen reader (NVDA in my case).

The only way to get silde content rendered by screen reader is to click on the actual slide, which is not convenient for most screen reader users.

Active slide .slick-current should have attribute tabindex set to "0"

http://jsfiddle.net/07vdsj40/

@leggomuhgreggo
Copy link
Collaborator

leggomuhgreggo commented May 26, 2016

Fiddle or it didn't happen

Edit: Thanks!

@ygatesoupe
Copy link
Author

Hi, I added a Fiddle link, can we reopen this ?

@andypillip
Copy link

Not only for screen readers, also for keyboard users this means they can never use the arrow keys, since those only work when a slide has focus.

@lordfpx
Copy link

lordfpx commented Aug 29, 2016

I confirm that bug too.

@kakt00c
Copy link

kakt00c commented Sep 16, 2016

i have this issue on my project as well.

@ygatesoupe
Copy link
Author

Hi, I fixed this on my slick fork 334fef8

@leggomuhgreggo
Copy link
Collaborator

@ygatesoupe thanks for the fork! Accessibility needs a big overhaul, and tab focus will definitely be a part of that. I want to go through and inventory the changes that need to be made, to make sure the a11y updates will be clean. If anyone is confident in their accessibility expertise and interested in helping identify all the issues, organize the PRs, and test that would be enormously helpful.

Appreciate everyone's feedback.

@nmitic
Copy link

nmitic commented Feb 1, 2018

Anyone found a fix for this? For me every slide except the active one has tabindex="-1" which means user can not use TAB to navigate through the dots.

This is what generated code looks like for all dots(slides) except the one that is selected.

<li role="presentation"><button type="button" role="tab" id="slick-slide-control04" aria-controls="slick-slide04" aria-label="5 of 6" tabindex="-1">5</button></li>

fiddle --> https://jsfiddle.net/8ojmk2fd/

This is not the case with SlickJS demos on --> http://kenwheeler.github.io/slick/

Is this a new bug, should I create new issues out of it?

edit: version 1.8.0

edit 2: Same bug is presented in version 1.8.1, but not on version 1.6.0 which is the one used on the slickJS web site.

edit 3: I was wrong Slick web site uses 1.8.0

@chipcullen
Copy link

I am seeing the same behavior that @nmitic is reporting, in 1.8.1.

@ZNS
Copy link

ZNS commented Apr 4, 2018

Tabindex is set to -1 for all buttons here for some reason:

'tabindex': '-1'

Commented that out and it seemed to work, but haven't tested with different options.

@esr360
Copy link

esr360 commented Aug 13, 2018

How is a user supposed to tab through each slide? I am displaying slides in a 6 * 2 grid using the following settings:

settings: {
    rows: 2,
    slidesPerRow: 6
}

12 "slides" are effectively visible per slide, user is to be able to tab through each one to select/deselect but currently doesn't seem possible.

@smitterko
Copy link

smitterko commented Jan 14, 2020

After doing a lot of research on this and trying to figure it out, I was able to get keyboard navigation to work with Slick 1.8.1. Make sure both these options are set for your Slick slider:

focusOnChange: true,
accessibility: true

Once those are set, you should be able to tab and hit the Enter key to navigate through the carousel.

Hope this helps someone else who is working on ADA compliance.

@televators
Copy link

@smitterko I really appreciate that. I'm having to do a crap load of accessibility work on a big government site and Slick is throwing a stick into the spokes big time.
I realized that turning on focusOnChange on an autoplay slider hijacks focus back to the slider even if you've gone down the page and have moved focus outside the slider. So, obviously that's not good and makes the option unusable unless your page is literally just the slider. I also have multiple sliders on most pages so doubly troublesome. I'm still seeing how well the accessibility option helps.
Leaving this for posterity in case someone takes up the mantle or does more work and sees this thread.

@mjhandy
Copy link

mjhandy commented Mar 3, 2022

Well is 2022, and I'm in the same boat. I have focusOnSelect, and accessibility both set to true. When a cloned item is set to slick-active, the tab-index is still -1.

@seanensemble
Copy link

I found that the active slides with class slick-active can be tabbed through. You can change the number of active slides with property slidesToShow.

So if you are showing 3 slides at a time, this should work.

slidesToShow : 3,

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

No branches or pull requests