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

I have only one slide and its replicate the inner content three times #2387

Open
Ayan-Amir opened this issue Jun 25, 2024 · 7 comments
Open

Comments

@Ayan-Amir
Copy link

here is settings:
const settings = { dots: true, infinite: true, speed: 500, slidesToShow: 1, slidesToScroll: 1, };
and slider code:
<Slider {...settings}> <div> <h3>1</h3> </div> </Slider>

Output:

image
@channing-magiceden
Copy link

I think it's the same issue as #2337

@VigilioYonatan
Copy link

any update aboyt this issue??

@dheroying
Copy link

in version 0.30.2, it's still the same.
Still no update for this?

@dheroying
Copy link

I've switched to using another library.
Please use this: https://github.com/davidjerleke/embla-carousel

@rcolepeterson
Copy link

rcolepeterson commented Jul 10, 2024

me too. have the problem. X 3
I fixed by setting infinite to false.
infinite: false

@VigilioYonatan
Copy link

adaptiveHeight: true is alternative bug

@ShilkovKonst
Copy link

ShilkovKonst commented Jan 17, 2025

I think it's the same issue as #2337

No, it's not the same issue.

me too. have the problem. X 3 I fixed by setting infinite to false. infinite: false

Yes, it fixes the problem. To avoid this strange behavior use a dynamic condition in "infinite" property:

const ImageSlider = ({ slides }) => {
  const settings = {
    infinite: slides.length > 1,
    // other setting's properties
  }
 return (
    <div className="slider-container px-8">
      <Slider {...settings}>
        {slides.map((slide, i) => (
          <div key={i}>
            {slide}
          </div>
        ))}
      </Slider>
    </div>

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

6 participants