Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Implement acessibility features #4

Closed
DouglasdeMoura opened this issue May 4, 2016 · 25 comments
Closed

Implement acessibility features #4

DouglasdeMoura opened this issue May 4, 2016 · 25 comments

Comments

@DouglasdeMoura
Copy link

Please check the page below:

https://www.w3.org/WAI/EO/Drafts/tutorials/sliders/

@ganlanyuan
Copy link
Owner

Will check this, thanks

@ganlanyuan
Copy link
Owner

Tiny-slider is still in progress right now, please give more ideas if possible.
Thanks

@epigeyre
Copy link

epigeyre commented May 10, 2016

This series of articles offer a nice sum up of accessibility best practices for carousels:

I thought this might help make your script even better!

@ganlanyuan
Copy link
Owner

Great, thanks
On Tue, May 10, 2016 at 6:11 AM Etienne Pigeyre notifications@github.com
wrote:

This series of articles offer a nice sum up of accessibility best
practices for carousels:

I thought this might help your script even better!


You are receiving this because you commented.

Reply to this email directly or view it on GitHub
#4 (comment)

@ganlanyuan
Copy link
Owner

ganlanyuan commented Jun 7, 2016

Hey,
Accessibility features added. Could you check?
Only for touch screen I couldn't figure out how to support. Any idea?

@epigeyre
Copy link

epigeyre commented Jun 8, 2016

Thanks, I will check as soon as I can and get back to you!

@epigeyre
Copy link

epigeyre commented May 17, 2017

Hello,

Sorry it's been so long! So I had time to check and here is my feeback:

  • aria-hidden -> OK.
  • aria-controls -> On the carousel pagination, if the number of items is set to more than one, the aria-controls value doesn't reflect this setting (it's selecting the next one instead of the n + 2 if we set items value to 2).
  • aria-selected -> OK.
  • Content order -> From an accessibility stand point, it makes more sense to have navigation and pagination above carousel.
  • Limiting tab selection -> tabindex="-1" should be added to every inactive slide.
  • Navigation keyboard control -> Add tabindex="0" to the Carousel navigation container and tabindex="-1" on both carousel navigation buttons.
  • aria-live -> In my opinion it depends too much on the purpose of the carousel to be implemented in a global solution so don't bother.

For touch screens I'm sorry but my Javascript skills are very limited, I can't help you...

Hope this helps!

@ganlanyuan
Copy link
Owner

Thanks @epigeyre for your feedback.
I will check these when I have time.

@ganlanyuan
Copy link
Owner

ganlanyuan commented May 26, 2017

  • Content order -> From an accessibility stand point, it makes more sense to have navigation and pagination above carousel.

Will update in next main version, since this will cause a DOM change.

  • Limiting tab selection -> tabindex="-1" should be added to every inactive slide.
  • Navigation keyboard control -> Add tabindex="0" to the Carousel navigation container and tabindex="-1" on both carousel navigation buttons.

Done

@ganlanyuan
Copy link
Owner

ganlanyuan commented May 26, 2017

  • aria-controls -> On the carousel pagination, if the number of items is set to more than one, the aria-controls value doesn't reflect this setting (it's selecting the next one instead of the n + 2 if we set items value to 2).

Will work on this maybe this weekend.
Done

@ganlanyuan
Copy link
Owner

  • Content order -> From an accessibility stand point, it makes more sense to have navigation and pagination above carousel.

This will be done from v2.0

@Eric-Draven
Copy link

How to place navigation and pagination under carousel?

@epigeyre
Copy link

@Eric-Draven The best way is probably to use position: relative on your slider's wrapper and position: absolute on your navigation and pagination elements so that you can place them wherever you want.

@Eric-Draven
Copy link

Thank you, I know this, but it would be nice to be able to change through the options.

@OD-fraja
Copy link

@ganlanyuan @epigeyre Regarding tabindex="0" on the controls container what was the reason behind it? Is that really needed? We use a company to audit our site and they logged this as an issue that tabindex="0" causes and extra tab which is not needed.

@ganlanyuan
Copy link
Owner

@OD-fraja So that it can be focused (instead of prev, next button been focused) and user can control the slider using arrow keys.

@OD-fraja
Copy link

@ganlanyuan Aha I see, makes sense. I did not know that you could use arrow keys to control the slider. That makes sense now. Thanks for your prompt reply.

@ganlanyuan
Copy link
Owner

@OD-fraja You're welcome

@missmatsuko
Copy link

Limiting tab selection -> tabindex="-1" should be added to every inactive slide.
Navigation keyboard control -> Add tabindex="0" to the Carousel navigation container and tabindex="-1" on both carousel navigation buttons.

Done

I'm just checking out the sliders on the demo page. I can see that the tabindex is set as described above, but I still can't seem to tab past a carousel without going through each slide. Is some JS that is programmatically focusing the inactive slides on tab?

@ganlanyuan
Copy link
Owner

@missmatsuko Hey, it's because of the <a> tag in each slide.

@missmatsuko
Copy link

@ganlanyuan Hmm, I see. I think the content inside the inactive slides really shouldn't be focusable, even if they have links in them.

@ganlanyuan
Copy link
Owner

You're right.
But it's too much for the slider to check all the possible focusable child elements of inactive slides and make them non-focusable.
I will search for ways which just need to work on the slides themselves.

@webpro-solutions
Copy link

The problem we're having with this, is that we are lazy loading the images so if we tab through and the images haven't loaded (which a user may do), then it shows an invalid image which is not ideal. I have went ahead and targeted our links and disabled the tab index just so this does not occur. However, I think it would provide a better UX if the tab index was only enabled for elements within the visible slide?

@camtin
Copy link

camtin commented Jan 30, 2020

Hi, I think it might be reasonable to check for focusable child elements, and make them tabindex -1. A technique I've seen used is to store the element's previous tabindex value in a data attribute, and "restore" it from that attribute when it's visible again. I'm going to open this up as a separate new issue and attempt to fix on my own fork.

@tombassrosenfeld
Copy link

@ganlanyuan @epigeyre the tabindex= -1 is causing issues if using navigation arrows outside of the nav container (setting custom prevButton and nextButton). Is there a way to only set tabindex= -1 if the nav is set to true?

rtrvrtg pushed a commit to slnsw/tiny-slider that referenced this issue Jul 21, 2023
Live Push 2021-07-03: fix visible slide range calculation
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

9 participants