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

swiper/react: onRealIndexChange auto-trigger issue with non-zero initialSlide even if runCallbacksOnInit is disabled #6976

Closed
5 of 6 tasks
bestseob93 opened this issue Aug 24, 2023 · 1 comment · May be fixed by abhishekbedi/framework7#1, Aarod23/nys-site#1, wierza/Team-project#148 or TaylorBundy/swiper#4
Labels

Comments

@bestseob93
Copy link

bestseob93 commented Aug 24, 2023

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/s/swiper-react-default-forked-h6sndy

Bug description

On initial render, passing a non-zero value to initialSlide as a Swiper prop triggers onRealIndexChange even if runCallbacksOnInit is disabled.

It only occurs in swiper/react and not in swiper.

Expected Behavior

initialSlide is a value that specifies the initial position, so those event listeners shouldn't be triggered on initial render.

Actual Behavior

No response

Swiper version

ALL

Platform/Target and Browser Versions

ALL

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
@bestseob93
Copy link
Author

#6971

@bestseob93 bestseob93 changed the title swiper/react: onSlideChange auto-trigger issue with non-zero initialSlide even if runCallbacksOnInit is disabled swiper/react: onRealIndexChange auto-trigger issue with non-zero initialSlide even if runCallbacksOnInit is disabled Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment