Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Slides jump on load with loop: true #600

Closed
1 task done
RectoVersoDev opened this issue Oct 17, 2023 · 4 comments
Closed
1 task done

[Bug]: Slides jump on load with loop: true #600

RectoVersoDev opened this issue Oct 17, 2023 · 4 comments
Labels
duplicate This issue or pull request already exists

Comments

@RectoVersoDev
Copy link

RectoVersoDev commented Oct 17, 2023

Bug is related to

  • embla-carousel (core package)

Embla Carousel version

  • v7.1.0 / 8.0.0-rc14

Describe the bug

  • When loop is set to true, the slides jump on load.

CodeSandbox

https://codesandbox.io/p/sandbox/inspiring-oskar-jqfp23

Steps to reproduce

  1. Set loop option to true
  2. Make slide size like 20%
  3. Load/Reload the page
  4. Slides jump

Expected behavior

No slides jump on load

Additional context

Astro website

@RectoVersoDev RectoVersoDev added the bug Something isn't working label Oct 17, 2023
@sarussss
Copy link
Contributor

sarussss commented Oct 18, 2023

Hi @RectoVersoDev
As far as I can see, it's not a bug, it's just that if you turn on loop and align center, before loading and running js Embla it will display differently than after loading js Embla (Any slider library works the same). To solve this, there is You can convert align to start
or you can somehow make the embla js load and finish running sooner, but that's usually not good in terms of performance.

I'm sorry that English is not my main language, I hope you understand what I mean.

@davidjerleke
Copy link
Owner

Hi @RectoVersoDev,

Thank you for your bug report. As @sarussss already mentioned, this isn't a bug. SSR (Server Side Rendering) isn't a feature that Embla supports at the time of writing. It's possible to add SSR support that will solve most cases, but this would increase the bundle size. I can't give exact numbers but my guess is that the bundle size would increase significantly.

I'm planning on creating a poll for future features to vote under the discussions tab when I get the time to do so. I'll be sure to include the SSR feature there.

Best,
David

@davidjerleke davidjerleke added duplicate This issue or pull request already exists and removed bug Something isn't working labels Oct 18, 2023
@RectoVersoDev
Copy link
Author

Hi @sarussss and @davidjerleke
Thank you for your answers !

You're right, when I set align to "start" there is no more jump. I understand what's happening now.

Sorry for the duplicate, I close the issue.
Have a great day ✌️

@davidjerleke
Copy link
Owner

@RectoVersoDev no worries. I'll be sure to add SSR to the vote for features list. Cheers!

@davidjerleke davidjerleke changed the title Slides jump on load with loop: true [Bug]: Slides jump on load with loop: true Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants