beyonk-group/svelte-carousel

Not working with an each loop inside of it

Noureldineadel65 opened this issue · 6 comments

I tried it with an each loop inside of it and it gave me this: siema.min.js:1 Uncaught TypeError: Cannot read property 'cloneNode' of undefined

@Noureldineadel65 please can you provide a REPL demonstrating the issue :)

I tried inside a REPL and it worked but when I wrap my each loop in my site with the Carousel component it gives me this issue and breaks my whole site, then gets back to normal when i remove the Carousel component.

Annotation 2020-06-27 165240

Unfortunately I can't diagnose an issue from a screenshot. Can you use the sapper template to create a reproduction I can try please?

@Noureldineadel65 this may be a bug, but easy to bypass while there is no PR for it.
The default value for perPage is 3. And in this example you sent, there are only 2 items. which means that perPage(3) is bigger than the available items(2)

To solve it, all you need to do is inform the value for perPage. like this: https://svelte.dev/repl/fe8f8199470b4183a0625afe2fe865b6?version=3.23.2

@johnyvelho Alright thanks a lot! I will close this