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

When Embla falls back to loop: false it replaces the user provided loop option #414

Closed
1 task done
davidjerleke opened this issue Jan 9, 2023 · 0 comments · Fixed by #415
Closed
1 task done
Labels
bug Something isn't working resolved This issue is resolved

Comments

@davidjerleke
Copy link
Owner

davidjerleke commented Jan 9, 2023

Bug is related to

  • embla-carousel (core package)

Embla Carousel version

  • v7.0.5

Describe the bug

  1. Initialize Embla with not enough slide content for the loop effect to work.
  2. Embla makes the decision that the carousel doesn’t have enough slide content for the loop effect to work. So it automatically falls back to loop: false.
  3. Change the slide content so it's enough to loop.
  4. Run reInit().
  5. When falling back to loop: false, Embla replaces the user provided loop option which was loop: true.
  6. So from now on every reInit() call without the options parameter will be with loop: false.
  7. What Embla should do is that it should reset the user provided loop option to loop: true after falling back to loop: false, which happens when when slide content isn’t enough for the loop effect to work.
  8. So the next time reInit() is called, Embla should try loop: true again.

Expected behavior

  • Embla shouldn't replace the user provided loop option when it falls back to loop: false.

Additional context

Thanks @pReya for reporting this bug. Discussed in:

@davidjerleke davidjerleke added the bug Something isn't working label Jan 9, 2023
davidjerleke added a commit that referenced this issue Jan 9, 2023
@davidjerleke davidjerleke linked a pull request Jan 9, 2023 that will close this issue
@davidjerleke davidjerleke changed the title When Embla falls back to loop: false it mutates the user provided loop option When Embla falls back to loop: false it replaces the user provided loop option Jan 9, 2023
davidjerleke added a commit that referenced this issue Jan 17, 2023
@davidjerleke davidjerleke added the resolved This issue is resolved label Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resolved This issue is resolved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant