Ionic-framework: Slides : drag trigger ionSlideDidChange incorrectly

Created on 27 Jan 2017  路  11Comments  路  Source: ionic-team/ionic-framework

Ionic version: (check one with "x")
[ ] 1.x
[x] 2.x

I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior:
If the user drag to get the next slide the event ionSlideDidChange is always triggered even if there isn't any next slide.
The current activeIndex of the slider is also increased even if the slide displayed is still the same (since there isn't any next slide).

Expected behavior:
The event should be triggered only if the slide actually changed.
The activeIndex should change only if the slide actually changed.

Steps to reproduce:
Here is a plunker that shows the issue : http://plnkr.co/edit/UFVQniL4Uf9LZ0jukXW3?p=preview

Related code:
See the plunker above.

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0
Ionic CLI Version: 2.1.17
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 1.0.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 7
Node Version: v6.9.2
Xcode version: Not installed
stale issue

Most helpful comment

Issue still present in v2.2.0.

All 11 comments

Thanks for opening an issue with us, we will look into this.

Do you have any ETA on this issue ? The changes on slides in RC5 broke some behaviour of my app since I'm listening to the ionSlideDidChange event.

Issue still present in v2.2.0.

Any updates on this? It's still happening in 3.1.1.

Any updates on this?

It's still happening in 3.3.0

And in 3.4.0 :)

I've created a PR for this. Guys, please have a look.

Awesome! Thanks Alex!!

@alexkonovalov Thanks !
@jgw96 One month later, can someone accept this PR ?

Another side effect of this bug is the deletion of the "swiper-slide-active" class on the last element.

Thanks for the issue! This issue is being closed due to inactivity. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Thank you for using Ionic!

Was this page helpful?
0 / 5 - 0 ratings