Open robhowells opened 3 years ago
I'm having an issue similar to yours where the arrows have the slick-disabled
class added to them after the afterChange
event is called. I was trying to manipulate those arrows after the slide finished animating. It seems that our problems could be resolved by a simple fix: trigger the afterChange
event at the end of the postSlide
function rather than at the beginning as is currently the case.
Background
There are a few instances where I need to alter the accessibility attributes added to the slider when the
accessibility
option is set totrue
.aria-label
- I'm using thecustomPaging
option to display button text in the pagination buttons (see fiddle). To meet accessibility requirements, I need to either alter the aria labels that get automatically added (e.g.1 of 3
) to match this text, or remove the aria labelstabIndex
- thetabIndex
of the active slide gets set to0
, adding that slide to the tab order. When a slide contains a list of elements, these elements all get read aloud when using some assistive technologies. To meet accessibility requirements I need to remove thetabIndex
on the slides and focus on the first item 'focusable' item in the side instead.https://jsfiddle.net/cns1h0Lb/8/
====================================================================
Issue
I was planning on utilising the
init
andafterChange
events to modify thearia-label
andtabIndex
. However it appears that the function where these attributes are added in slick.js (Slick.prototype.initADA
) is invoked after the init and afterChange triggers are set e.g.This means that further functionality gets added after
init
andafterChange
have be triggered.====================================================================
Proposed solution / feature request
accessibleReady
?Either would allow someone to hook into these attributes and alter them as needed.