ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
50.94k stars 13.52k forks source link

bug: wrong $index in slider when does-continue=true #3209

Closed konsultaner closed 9 years ago

konsultaner commented 9 years ago

Type: bug

Platform: all

I used the slider with two images like this:

<ion-slide-box on-slide-changed="currentSlide=$index" auto-play="true" does-continue="true" show-pager="false">
    <ion-slide ng-repeat="image in images">
        <img ng-src="{{image.src}}" width="100%"/>
   </ion-slide>
</ion-slide-box>

when outputting the currentSlide value, it turns out to show 0,1,2,3,0,1,... instead of only 0,1,0,1,... I helped myself with

(currentSlide || 0) % images.length

I needed to add the || 0 because the change event does not fire before any rotation happened.

Ionitron commented 9 years ago

Greetings @konsultaner!

I've closed this issue because my sensors indicated it was old and inactive, and may have already been fixed in recent versions of Ionic. However, if you are still experiencing this issue, please feel free to reopen this issue by creating a new one, and include any examples and other necessary information, so that we can look into it further.

Thank you for allowing me to assist you.

konsultaner commented 9 years ago

has anyone ever reviewed this bug? seems to be a very simple one?