question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Swiper does not call slideChange when slidesPerView: 'auto'

See original GitHub issue

This is a (multiple allowed):

  • bug

  • enhancement

  • feature-discussion (RFC)

  • Swiper Version: 4.4.2.

  • Platform/Target and Browser Versions: Ubuntu 18.04; Chrome 70.0.3538.77 (Official Build) (64-bit).

  • Live Link or JSFiddle/Codepen or website with isssue: DEMO.

What you did

Just try to swipe slides and you will see that slideChange event is not triggered. Using this event I want to get realIndex. Just want to draw your attention that there are 3 slides but just 2 nav bullets (in my case I do not care what realIndex can be, because I can simply do ±1, but what I really need is a workable slideChange event).

Expected Behavior

Swiping of slides should trigger slideChange event in order to let me get realIndex.

Actual Behavior

Swiping of slides does not trigger slideChange event.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:2
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
alejandroiglesiascommented, May 12, 2019

In my case, I also use slidesPerView: 'auto' and I get the slideChange, slideChangeTransitionStart, and slideChangeTransitionEnd events except when going to the last slide. When I comment out the slidesPerView option (leaving it to the default value), all those events are triggered correctly for all slides.

4reactions
begonaalvarezdcommented, Jul 24, 2020

I am experiencing the same issue and centeredSlides: true, though it fixes it, is not an option for me because I also need the slides to be left aligned. Did anybody find a solution? 🙏

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular swiperJS slideChange event does not work when ...
i added a method called when slideChange,this method only logs the active index,and it works perfect. but then i added: [initialSlide]="2".
Read more >
Swiper API
This param intended to be used only with slidesPerView: 'auto' and slidesPerGroup: 1 . When enabled, it will skip all slides in view...
Read more >
swiper active slide | The AI Search Engine You Control
From looking at the classes, the centered slide doesn't actually look like the ... Currently, multirow Swiper is not compatible with slidesPerView:'auto', ...
Read more >
Top 5 swiper Code Examples - Snyk
swiper -container', { // Optional parameters direction: 'horizontal', loop: false, slidesPerView: "auto", noSwiping: true, noSwipingClass: "no-swipe", // ...
Read more >
View Raw - UNPKG
It doesn't support all of Swiper's features, but potentially should bring a much ... slidesPerView: 'auto' is currently not compatible with multirow mode, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found