Search code examples
ionic-frameworkion-slides

Ionic New Slides - Swiper SlideTo bug


I'm using the latest ionic 1 version 1.3.3. I've a list of items. On click any of them, it opens the ion-slides with few left and right items (which I'm letting it to control dynamic). The issue is when the slider gets ready, it shows the correct index for the first or couple of time. But shows the first index afterwards when we come back to the list and click on another item. I've used $scope.slider.slideTo to update the index. I also destroy slides instance before leaving but didn't get success.


Solution

  • Looks like it was not .slideTo() bug. But I think they should provide callbacks for the update methods. Actually I've binded ng-hide on the slider for the loading. So the slider was unable to render until the list is prepared. I was updating the index and then toggling the loading. Resulting conflicts with update slide and index.

    I placed style visibility: hidden with ngclass instead of ng-hide. It works perfect.