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
51.09k stars 13.51k forks source link

bug: the 'ionPager' directive have a bug of 'active' state #4495

Closed tomkrus007 closed 8 years ago

tomkrus007 commented 9 years ago

if only two 'ion-slide' in 'ion-slide-box',the ion-pager's 'active' state will be wrong.

solution: add some code to the 'ionPager' directive . like this: .directive('ionPager', function() { return { restrict: 'E', replace: true, require: '^ionSlideBox', template: '

', link: function($scope, $element, $attr, slideBox) { var selectPage = function(index) { var children = $element[0].children; var length = children.length; for (var i = 0; i < length; i++) { //=======add=====// if(length < index + 1){ index = index - 2; } //=======end=====// if (i == index) { children[i].classList.add('active'); } else { children[i].classList.remove('active'); } } };

Ionitron commented 8 years ago

Greetings @tomkrus007!

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.