akiran / akiran/react-slick

New behaviour of focusOnSelect: true interferes with custom keyboard nav using child elements

Aperta
#2,294 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
11.9k
Fork
2.1k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Version 0.27.10 introduced a new behaviour for the setting focusOnSelect. This behaviour causes a problem if you have rolled your own keyboard controls and are using slickGoTo when an element inside the slide's parent div gains focus; focus is forced up to the parent div, meaning that pressing tab again will first move focus to the inner element, but then it'll be moved back out to the parent by the custom focusOnSelect behaviour. The user can never tab to the next slide.

We have a number of Slick Slider carousels in which we built our own keyboard navigation, and the new behaviour of focusOnSelect breaks this.

I'm not sure this custom behaviour would ever add anything? Perhaps it could be reverted?

Or at the least, reading this issue might help someone else!

[https://github.com/akiran/react-slick/compare/0.27.9...0.27.10](https://github.com/akiran/react-slick/compare/0.27.9...0.27.10)

```
if (this.props.focusOnSelect) {
const nodes = this.list.querySelectorAll(".slick-current");
nodes[0] && nodes[0].focus();
}
```

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.