0

How to handle tab keypress using react-slick-slider?

It moves through slides, but it does not change the active one.

Here is the demo: https://codesandbox.io/s/slick-slider-tab-docbw5

When you navigate through slides via Tab button, it moves to the right, but the active slide does not change. You can see it in the dots, the active one is still at position 1. Also when you reach the end, you can still press the next button, but you can't the prev button, since the active one is still the first one.

Also with Shift + Tab it moves to the last one, but still does not change the active one.

What is the proper way to handle that? Adding tab index -1 is not the solution I am looking for.

Oktay Yuzcan
  • 2,097
  • 1
  • 6
  • 15
  • I tried to research to handle `slider` using the `Tab` key in `react-slick` docs, but unfortunately, there is nothing like that even if you wanna try to use slide sliders by `Tab` key, it won't run(won't slide using `Tab` key), and active slide! only it will slide by clicking dots and active slide as it is. there is no method like that using `Tab` key. – nuser137 May 16 '23 at 16:09
  • But users should be able to go through the actions via Tab button. I don't want to stop them from this. – Oktay Yuzcan May 16 '23 at 17:26
  • ik but I tried to use slide the sliders using `Tab` key if you seriously try to use `Tab` key to scroll it doesnt work even in the docs! but you should try yourself! – nuser137 May 16 '23 at 17:27

0 Answers0