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

Sponsored issue: Infinite Loop Renders Duplicate Slides When SlideToShow is Less Than the Number of Slide Elements #2286

Open
usmanasif opened this issue Sep 28, 2023 · 0 comments

Comments

@usmanasif
Copy link

When enabling the infinite loop feature on Slick Carousel in React, it appears to render duplicate slides if the slidesToShow prop is set to a value greater than the total number of slide elements passed as children. The duplication occurs, and although the duplicated slides have different data-index values, it leads to unexpected behavior in certain scenarios.

Steps to Reproduce:

  1. Include the Slick Carousel component in a React project.
  2. Set the infinite prop to true.
  3. Set slidesToShow to a value greater than the total number of slide elements.
  4. Observe the rendered output

Expected Behaviour:
The infinite loop should work seamlessly without duplicating slides, even when slidesToShow is greater than the total number of slides. It should only not show next and previous button and show single dot.

Environment:
Slick Carousel Version: "^0.29.0"
React Version: "18.2.0"

Priority Support

  • @usmanasif is using Mintycode to fund this issue.
  • If you would like to accept amount bounty for solving this issue join Mintycode.
  • Thank you in advance for helping.

mintycode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant