Splidejs/svelte-splide

Thumbnail listeners doesn't work if rendered in array

multipliedtwice opened this issue · 1 comments

Checks

Version

0.2.5

Description

Hello, thank you for an awesome library. Not sure if it's a question or bug report. I trying to make a product listing with sliders and thumbnails by following your example from the repo.

Slider thumbnails don't work except for ones in the last iteration of the loop.

Reproduction Link

https://codesandbox.io/s/naughty-ptolemy-owfpb0?file=/App.svelte

Steps to Reproduce

  1. Try to click thumbnails in the sandbox

Expected Behaviour

Click on thumbnail changes slides

Close this since this is not a splide bug.

You iterate over main and thumnail carousels 6 times with same main and thumbs variables. That's why only the last one works.
You need to call sync for each pair (6 times).