Embla-carousel: The slides are not showing at the end of the carousel with a large number of slides.

Created on 9 Sep 2020  路  9Comments  路  Source: davidcetinkaya/embla-carousel

I used your example with Variable Widths and changed the number of slides https://codesandbox.io/s/embla-carousel-variablewidths-react-forked-4nshv You can see that 11 last slides are not showing. Also, I output scroll positions and got

console.log(embla.scrollSnapList());
[0, 0.07338388461443308, 0.20792409885950375, 0.3302336656688356, 0.47700452734964505, 0.6176616115385568, 0.7093961059845131, 0.8684007075530048, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]

The snap point positions for last 12 slides equals to 1. Is it normal?

demonstration not a bug resolved

Most helpful comment

Sorry, It's my fault again, I didn't set the width for the last one, 20th. You can close this issue. Thank you.

All 9 comments

Hello @duza,
I can only see 9 slides on your forked sandbox?

CE7C1E1A-9A52-4E59-98C8-41F383F32992

Did you forget to update it?

Hi @davidcetinkaya, sorry I forgot to save it :( I saved changes now for forked version. Make sure that the problem exists.

Thanks @duza, I will take a look at it as soon as possible and let you know when I have something.

@duza you haven鈥檛 specified any base width for the slides? As you can see in the CSS slide 1 to 9 all have widths specified. You either need to add content that takes up space to the slides, or specify widths if they鈥檙e empty.

06E7B989-7910-4D1C-B2F1-67CCEFED4BE6

Let me know if it works.

Best
David

@davidcetinkaya Yeap, you are right. Thank you very much

@duza no worries. Congratulations, you opened issue number #100 馃槂. Enjoy!

Kindly
David

@davidcetinkaya But you know, when I fixed width in css the last slide didn't show at all.

@duza Have you updated the CodeSandbox so I can take a look?

Sorry, It's my fault again, I didn't set the width for the last one, 20th. You can close this issue. Thank you.

Was this page helpful?
0 / 5 - 0 ratings