Skip to content

Commit

Permalink
Merge pull request #3097 from tbirdsall/wcag_num_slides_fix
Browse files Browse the repository at this point in the history
Changed the logic for adding aria describedby attribute
  • Loading branch information
Greg Westneat committed Sep 12, 2017
2 parents f9a8733 + 0c3bcfb commit 4909f26
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions slick/slick.js
Original file line number Diff line number Diff line change
Expand Up @@ -1322,9 +1322,12 @@
});

if (slideControlIndex !== -1) {
$(this).attr({
'aria-describedby': 'slick-slide-control' + _.instanceUid + slideControlIndex
});
var ariaButtonControl = 'slick-slide-control' + _.instanceUid + slideControlIndex
if ($('#' + ariaButtonControl).length) {
$(this).attr({
'aria-describedby': ariaButtonControl
});
}
}
});

Expand Down Expand Up @@ -1697,7 +1700,7 @@

if (_.options.accessibility === true) {
_.initADA();

if (_.options.focusOnChange) {
var $currentSlide = $(_.$slides.get(_.currentSlide));
$currentSlide.attr('tabindex', 0).focus();
Expand Down

0 comments on commit 4909f26

Please sign in to comment.