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 beforeSlideChangeStart event fires only once at first move #5913

Closed
5 of 6 tasks
dannyarty opened this issue Jul 26, 2022 · 5 comments
Closed
5 of 6 tasks

Swiper beforeSlideChangeStart event fires only once at first move #5913

dannyarty opened this issue Jul 26, 2022 · 5 comments

Comments

@dannyarty
Copy link

Check that this is really a bug

  • I confirm

Reproduction link

https://codepen.io/dannyarty/pen/yLKzYqN

Bug description

Swiper beforeSlideChangeStart event fires only once on first slide change. Same issue with similar events like beforeTransitionStart, slideChange, slideChangeTransitionEnd, slideChangeTransitionStart, slideNextTransitionEnd, slideNextTransitionStart etc.

Expected Behavior

Fire everytime before/after active slide changed

Actual Behavior

Fires only once after first active slide changed

Swiper version

8.3.1

Platform/Target and Browser Versions

Windows Chrome 103.0.5060.134 64-bit

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
@Florinstruct
Copy link

Florinstruct commented Mar 31, 2023

I am still experiencing this bug in 9.1.0

For some perspective:
The native prev/next buttons trigger twice, skipping slides, so I had to build my own navigation using swiper.slidePrev() and swiper.slideNext(). Doing that though, beforeSlideChangeStart does not trigger consistently. slideChange does, but with that I don't get the activeIndex of the slide we just left...

EDIT: even using the native navigation, beforeSlideChangeStart will not trigger consistently.

@davejtoews
Copy link

I'm seeing this issue on v10.3.0

@dliebner
Copy link

dliebner commented Nov 5, 2023

Seeing this on v11.0.3

@darQrrR
Copy link

darQrrR commented Apr 24, 2024

Seeing this on v.11.1.1

@suxscribe
Copy link

suxscribe commented Jul 23, 2024

Same on v.11.1.4

Seems it only happens when loop is enabled. Because in that case currentSlide and previousSlide indexes become equal at some point.
One workaround is to set rewind: true instead of loop

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

6 participants