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

When we click pagination, not loading previous or next slides in time #6768

Closed
5 of 6 tasks
MrSeaWave opened this issue Jun 19, 2023 · 1 comment
Closed
5 of 6 tasks
Labels

Comments

@MrSeaWave
Copy link

MrSeaWave commented Jun 19, 2023

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/p/sandbox/swiper-react-autoplay-forked-nnvnvn?file=%2Fsrc%2FApp.jsx%3A27%2C11

Bug description

when we click on the specified pagination button, not loading the previous or next slides in time.
(the similar issue are: #6540, #6451

The code is:

export default function App() {
  let data = [...new Array(9)].map((_, i) => i);
  return (
    <>
      <Swiper
        slidesPerView={"auto"}
        loop={true}
        centeredSlides={true}
        spaceBetween={40}
        // loopedSlides={1}
        pagination={{
          clickable: true,
        }}
        navigation={true}
        modules={[Pagination, Navigation]}
        className="mySwiper"
      >
        {data.map((i) => {
          return (
            <SwiperSlide key={i}>
              <Slide id={i} />
            </SwiperSlide>
          );
        })}
      </Swiper>
    </>
  );
}

function Slide({ id }) {
  return (
    <div
      style={{
        background: "#cff",
        width: 400,
        height: 300,
        // transform: "scale(0.75)",
      }}
    >
      Slide {id}
    </div>
  );
}
notload.mov

Expected Behavior

Previous/next slides appearing in time.

Actual Behavior

Previous/next slides not appearing in time.

Swiper version

9.4.1

Platform/Target and Browser Versions

macOS Chrome

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • Make sure this is a Swiper issue and not a framework-specific issue

Would you like to open a PR for this bug?

  • I'm willing to open a PR
@nolimits4web
Copy link
Owner

Latest Swiper is on v10 already and a lot were fixed there related to loop. If issue replicates with v10, please open a new one

Repository owner locked and limited conversation to collaborators Aug 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants