Embla-carousel: Are .scrollProgress and .selectedScrollSnap unavailable, if loop: true?

Created on 23 Feb 2021  路  3Comments  路  Source: davidcetinkaya/embla-carousel

Good day, David & Friends!

First of all, thank you very much for creating this and maintaining it in such an incredible manner.
I just fought my way through 3 other repos and ended up here after a lot of frustration.

I would like to create an infinite loop, while showing the current slide as a fraction:
image

If I understand right, .scrollProgress and .selectedScrollSnap become unavailable, if loop is set to true?

I suppose this is by design, but if not, please tell me and I will create a codesandbox demo.

All the best,

Leo

not a bug resolved

All 3 comments

Hi Leo (@Hahlh),

Thank you. Both selectedScrollSnap and scrollProgress are available when loop: true.

What do you want to achieve?

Kindly
David

Hey David!

Thank you for the fast answer.
I thought that I had it reproduced with one of the example codeboxes earlier. Now I tried to build an example for you again and can't. I must have called selectedScrollSnap at some wrong place so that the rerendering or something similar screwed up the count.
Now calling the method using the callbacks for prev and next works like a charm.

I will close this and reopen, if really necessary.

Thanks again!

Hi again Leo (@Hahlh),

I鈥檓 glad you got it sorted. Thanks for getting back to me and enjoy.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RectoVersoDev picture RectoVersoDev  路  3Comments

th-km picture th-km  路  5Comments

davidspiess picture davidspiess  路  4Comments

wopian picture wopian  路  7Comments

cliffordfajardo picture cliffordfajardo  路  5Comments