react-slick icon indicating copy to clipboard operation
react-slick copied to clipboard

Last item is shown

Open Vince-vegas opened this issue 4 years ago • 6 comments

Why the last item is shown. I set it to centerMode: true

const App = () => {
  const settings = {
    dots: true,
    cssEase: 'linear',
    infinite: true,
    speed: 500,
    slidesToShow: 2,
    slidesToScroll: 2,
    centerMode: true,
  };

  return (
    <Fragment>
      <div className="text-center">
        <h2> Single Item</h2>
        <Slider {...settings}>
          <div>
            <h3>1</h3>
          </div>
          <div>
            <h3>2</h3>
          </div>
          <div>
            <h3>3</h3>
          </div>
          <div>
            <h3>4</h3>
          </div>
        </Slider>
      </div>
    </Fragment>
  );
};

Vince-vegas avatar Jul 10 '20 16:07 Vince-vegas

You have to set the initialSlide prop which indicates the index of the slide to start at.

carlitosz avatar Jul 15 '20 15:07 carlitosz

initialSlide didn't work for me personally, but setting infinite: false worked

ghost avatar Jul 23 '20 13:07 ghost

Does anyone solve it

Vince-vegas avatar Jul 25 '20 14:07 Vince-vegas

infinite: false

yes it works, but I also need initialSlide=0 and infinite=true

wuliupo avatar Aug 03 '20 07:08 wuliupo

I also need to use infinite=true and initialSlide=0, when i do use this config last slide is shown first

pedrohasf avatar Aug 11 '20 11:08 pedrohasf

This still seems to be an issue, is there any thoughts on a resolution for this please?

theandylovegrove avatar Sep 12 '22 02:09 theandylovegrove