igordanchenko / yet-another-react-lightbox

Modern React lightbox component
https://yet-another-react-lightbox.com
MIT License
830 stars 38 forks source link

Image slider loop not stop #278

Closed mah12345o closed 3 months ago

mah12345o commented 3 months ago

Describe the bug

slider with img and video scroll infinite loop ,

Expected behavior

Want to stop at end of slider.

How to reproduce

"use client"; import * as React from "react"; import Lightbox from "yet-another-react-lightbox"; import "yet-another-react-lightbox/styles.css";

export default function Slider() { const [open, setOpen] = React.useState(true);

return ( <> <button type="button" onClick={() => setOpen(true)}> Open Lightbox

  <Lightbox
    open={open}
    close={() => setOpen(false)}
    slides={[
      {
        src: "https://logiqproperty.blr1.digitaloceanspaces.com/production/properties/65e572897f9bae79300eafd7/thumbnail/1716442158-rivanta-vibgyor-brochure_page-0010.webp",
        alt: "image 1",
        width: 3840,
        height: 2560,
      },
      {
        src: "https://logiqproperty.blr1.digitaloceanspaces.com/production/properties/65e572897f9bae79300eafd7/images/1716442149-31-01-2023-16751406390.webp",
        alt: "image 1",
        width: 3840,
        height: 2560,
      },
      {
        src: "https://logiqproperty.blr1.digitaloceanspaces.com/production/properties/65e572897f9bae79300eafd7/images/1716442149-31-01-2023-16751406960.webp",
        alt: "image 1",
        width: 3840,
        height: 2560,
      },
    ]}
  />
</>

); }

Screenshots / Logs

No response

Additional context

No response

igordanchenko commented 3 months ago
carousel={{ finite: false }}

https://yet-another-react-lightbox.com/documentation