splide icon indicating copy to clipboard operation
splide copied to clipboard

Link focus issue on "destroyed" slider

Open 2ndkauboy opened this issue 1 year ago • 3 comments
trafficstars

Checks

  • [X] Not a duplicate.
  • [X] Not a question, feature request, or anything other than a bug report directly related to Splide. Use Discussions for these topics: https://github.com/Splidejs/splide/discussions

Version

v4.1.3

Description

Splide has an option to "destory" the slider on a certain breakpoint. This works fairly well, but it introduces an accessibility issue. When the slides contain links, they are no longer focusable, since Splide sets a tabindex="-1" on every "inactive slide". Since in the "destroy" state, all slides are visible and therefore "active", this tabindex="-1" and other accessibility properties should be removed (e.g. aria-hidden="true" does get removed correctly) .

Reproduction Link

https://codepen.io/2ndkauboy/pen/VwOvWpG

Steps to Reproduce

  1. Create a slider with links inside the slides.
  2. Set the option to destroy the slider at a certain breakpoint.
  3. Test keyboard navigation of links inside the slides.

Expected Behaviour

Links (and other focusable elements) inside the slider should be focusable when "destroyed".

2ndkauboy avatar May 16 '24 12:05 2ndkauboy