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: ion-slides become list when navigate away then back #4039

Closed LunarDevelopment closed 9 years ago

LunarDevelopment commented 9 years ago

Type: bug

Platform: all

Hello!

EDIT: Below is not solved yet, however I have found that if I manually call $ionicSlideBoxDelegate.update() by a button press whenI return to the view with the bug, this returns the slides to a pagered styling. I have an issue which I'm not seeing anywhere else on github/ stack overflow.

Ive made an sliderbox with ng repeat, which works great, however if I click on a slide it intentionally takes me to a new page (which has a back button).

If I then go back to the previous page which holds the slider box it has broken its styling and has become a list of slides, stretching the page etc. they are still swipable, however they disappear from the page and leave a white block.

heres the code, then below are the screen prints (tested in gulp serve and on device)

 <ion-slide-box>
    <ion-slide ng-repeat="item in discovery.discoveredCapsules" >
        <div ng-click="discovery.viewCapsule(item)" class="">
        <img ng-src="{{item.icon.iconUrl}}">
        <h2>{{item.title}}</h2>
        <p>{{item.owner}}</p>
        <p>{{item.birthDateTime | date:'medium'}}</p>
      </div>
    </ion-slide>
</ion-slide-box>
    vm.discoveredCapsules = Capsules.discoveredCapsules;
    vm.getCapsules = function () {
      var rawCapsules = Data.discoveries;
      angular.forEach(rawCapsules, function (capsule) {
        vm.discoveredCapsules.push((vm.createCapsule(capsule)));
      });
    };

image

Becomes:

image

LunarDevelopment commented 9 years ago

Not sure what I've done but this has fixed itself through my tinkering.

I wish I had time to recreate the issue and report on the fix for anyone else but I dont at the min, if someone has the same issue just send me a message / comment here and I'll look into it for them.