focusOnSelect doesn't work when a filter is applied to synced sliders
See original GitHub issueA very simple issue which could be simulated like this:
Set up
- 2 synced sliders
- slider#2 set up:
- slidesToShow > 1 (e.g. 3)
- focusOnSelect = true
- a filter which filters both sliders (e.g. ‘:even’)
Expected and Actual behavior
Once the filter has been applied to both sliders, clicking on slider-nav
items should navigate to the same items in slider-for
. Instead, Slick navigates to a wrong item, in some crazy manner.
Test Case
Try clicking on slide3
text => and then on slide7
in this jsFiddle test case.
Bug Explanation
Slide attribute data-slick-index
, which is used for navigation, cannot be relied on once a filter has been applied. Natural order of slides should be used instead.
Fix is to follow…
Issue Analytics
- State:
- Created 9 years ago
- Reactions:1
- Comments:11 (1 by maintainers)
Top Results From Across the Web
jQuery Slick carousel filtering not working when used with ...
The code for slide filtering based on product color (which is when the selected variant is equal to the image alt) which doesn't...
Read more >slick - the last carousel you'll ever need - Ken Wheeler
slick is a responsive carousel jQuery plugin that supports multiple breakpoints, CSS3 transitions, touch events/swiping & much more!
Read more >kenwheeler/slick - Gitter
Hi. "afterchange" method is not working on devices. I have the slider with images and videos slide next item automatically if the current...
Read more >Solved: slicer & filter not in sync - Microsoft Power BI Community
Solved: hello, i want to ask, why my filter & slicer not in sync, like if i choose ... the filter page doesnt...
Read more >bd-slick-carousel - npm
To start working with Slick right away, there's a couple of CDN ... asNavFor, string, $(element), Enables syncing of multiple sliders.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
My variant of solution, based on previous “codepens”.
.gallery_slider - main slider .gallery_thumbs - thumbs slider .filternav ul li a - filter links (albums), their href=“#id” (id = album id), all slides (in both sliders) have id as “class” value. So, each slide can be in several albums. For example, clicking on link with href=“#dir1” will filter all slides (in both sliders), that have class=“… dir1 …”
base on the solution of @LucasFlicky , here is a working version without plugin’s core modifications http://codepen.io/Colir/pen/PWQqEE