maxmarinich / react-alice-carousel

React responsive component for building content galleries, content rotators and any React carousels
MIT License
832 stars 91 forks source link

Responsive not working well on desktop view #304

Closed EmmanuelVictor62 closed 7 months ago

EmmanuelVictor62 commented 8 months ago

Hello @maxmarinich , I have a page where I am currently using the slider and the responsive viewport at over 1000 is set to 2, but the slider returns 2 items and a half of the third one, the expected behavior is for the 2 items to take up the space completely

image

 const [responsive] = useState({
    0: { items: 1 },
    1000: { items: 2 },
  });

<Carousel responsive={responsive}>{items?.map}</Carousel>

<div className={styles["carousel__wrapper"]}>
      <CarouselButton icon="arrowLeftCircle" onClick={handlePrevButtonClick} />
      <AliceCarousel
        disableDotsControls
        disableButtonsControls
        disableSlideInfo
        mouseTracking
        responsive={responsive}
        ref={carouselRef}
        keyboardNavigation
      >
        {children}
      </AliceCarousel>
      <CarouselButton icon="arrowRightCircle" onClick={handleNextButtonClick} />
    </div>
maxmarinich commented 8 months ago

Hey @EmmanuelVictor62! Looks like there is a problem with your CSS. You should create a complete example on any public service (eg https://codesandbox.io) or git repo.

EmmanuelVictor62 commented 7 months ago

Thanks for the reply @maxmarinich, I have been able to identify the issue