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 #7067

Closed
5 of 6 tasks
MrSeaWave opened this issue Sep 27, 2023 · 1 comment
Closed
5 of 6 tasks

Comments

@MrSeaWave
Copy link

MrSeaWave commented Sep 27, 2023

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/p/sandbox/v10-3-swiper-prev-next-slides-g4zqcq?file=%2Fsrc%2FApp.jsx%3A1%2C1-62%2C1

Bug description

when we click on the specified pagination button, not loading the previous or next slides in time.
(the same issue is: #7011

The code is:

import React, { useRef, useState } from "react";
import pkg from "../package.json";
// Import Swiper React components
import { Swiper, SwiperSlide } from "swiper/react";

// Import Swiper styles
import "swiper/css";
import "swiper/css/pagination";
import "swiper/css/navigation";

import "./styles.css";

// import required modules
import { Pagination, Navigation } from "swiper/modules";

export default function App() {
  let data = [...new Array(9)].map((_, i) => i);
  return (
    <>
      <h1 style={{ position: "absolute", zIndex: 1000 }}>
        Swiper Version: {pkg.dependencies.swiper}{" "}
      </h1>
      <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>
  );
}
swiper10.3.mov

Expected Behavior

Previous/next slides appearing in time.

Actual Behavior

Previous/next slides not appearing in time.

Swiper version

10.3.0 & 10.2.0 & V9

Platform/Target and Browser Versions

macOS Chrome 116.0.5845.187

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

Move to Swiper Core or Swiper Element (as recommended in docs)

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

2 participants