davidjerleke / embla-carousel

A lightweight carousel library with fluid motion and great swipe precision.
https://www.embla-carousel.com
MIT License
5.87k stars 178 forks source link

Unable to access and move through carousels with the keyboard. #278

Closed didier closed 2 years ago

didier commented 2 years ago

Feature request is related to

Is your feature request related to an issue?

I'm unable to focus on or navigate the carousel with my keyboard.

Describe the solution you'd like

For accessibility reasons, I would expect interactive elements to be interactive with a keyboard as well as a mouse.

Describe alternatives you've considered

There really isn't an alternative to this, aside from not supporting it at all.

Additional context

n.a.

davidjerleke commented 2 years ago

Hi @didier,

As of v6, Embla Carousel accepts plugins. Feel free to create a plugin called embla-carousel-keyboard-nav if you want. I can provide some guidance to get you started.

Two friendly reminders:

  1. Please respect my decision here.
  2. This issue is a duplicate, and this has been requested before in issue #53. Continue further discussions there. Please search existing issues before creating a new issue.

Kindly, David

davidjerleke commented 2 years ago

Duplicate of #53.

dathmart commented 2 years ago

@didier I was having issues with keyboard navigation as well before I found this issue thread. This should allow your carousel to be navigated using Tab( + Shift).

davidjerleke commented 2 years ago

@dathmart thanks for the update. Although they’re similar, I guess this feature request is more about using the left/right arrow keys to scroll to the previous/next slide, rather than tab accessibility. It might be worth noting that the tab accessibility code works for slides with tab index set or with focusable children inside. Thanks for sharing the update though! It might help others looking for the tab accessibility feature 🙂.