Closed T-Fletcher closed 8 months ago
We follow the slick-carousel API. So we can't add new options.
You can implement this usecase with customPaging
feature or passing custom CSS class to dotsClass
https://react-slick.neostack.com/docs/example/custom-paging
@akiran No worries, I don't believe the customPaging
feature gives this level of control as while you can customize the rendered HTML output of the controls, you can't change where that HTML is added semantically (my original issue).
I'll stick with a patch for my case, but it'd be great to see this added to Slick someday.
Situation
I'm replicating a slideshow widget using React Slick to serve slides containing images wrapped in links.
This functionality could be hand-rolled but given my project already use React Slick elsewhere and the control it provides, I've gone down this path.
The UI I need to copy has the dots/slide group titles above the slides themselves i.e. pseudocoded:
In my component, I've used
appendDots
andcustomPaging
to insert text from slide group headings into the Dots as navigation:Which results in:
Problem
This works nicely except for one snag:
By default, Dots render under the slide, and there seems to be no way to change this at a HTML level. There may be a good reason this isn't a feature?
This creates an accessibility issue when dots visually appear high up or above the slides: tabbing through the page skips the dots, jumps below to any tab-able elements in the slides, then jumps back up to the dots navigation. This is confusing and jarring for users.
The prevailing wisdom around altering element positions and tabbing order is to just fix the HTML wherever possible, and only tamper with
tabindex
when this cannot be done.Proposed solution
I'd like to add a prop that lets users specify if the dots should be rendered above or below the slideshow, provided this doesn't clash with existing features. Something like:
This would turn the above HTML into:
People have asked about how to move the dots visually, but apparently not semantically (unless I just can't find it).
Would anyone else find this useful?
Related issues
114
1441