ionic2 - vertical scrolling inside of a slide
I have a couple of slides which have dynamic content that is added to them. The problem is the content inside of the slides doesn't scroll. So if I have a lot of items only some show and there is no ability to slide. How can I make it so the content in my lists slides inside of their slides?
<ion-content>
<ion-slides (change)="onSlideChanged($event)">
<ion-slide >
<ion-list>
<ion-item *ngFor="#item of items1; #i = index">
<h2>{{item}</h2>
</ion-item>
</ion-list>
</ion-slide>
<ion-slide>
<ion-list>
<ion-item *ngFor="#item of items2; #i = index">
<h2>{{item}</h2>
</ion-item>
</ion-list>
</ion-slide>
</ion-slides>
</ion-content>
Here is my css temporary fix (it's very hacky and I hate it):
ion-slide {
.slide-zoom {
height: calc(100vh - 143px);
overflow-y: auto;
}
}
The 143px comes from the the addition of 60px for top header, 41px for bottom tabs, plus a 16px vertical padding on my ion-content
That solution works perfectly until you want an
I ended up with
.html
<ion-slides>
<ion-slide>
<ion-content>
<ion-infinite-scroll (ionInfinite)="doInfiniteFetchProducts($event)" *ngIf="...">
<ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll>
</ion-content>
</ion-slide>
<ion-slide>
<ion-content>
<...>
</ion-content>
</ion-slide>
</ion-slides>
.scss
ion-slide {
.slide-zoom {
height: 100%;
ion-content {
.scroll-content {
margin-bottom: 0px !important;
}
}
}
}
ion-slide{
overflow: auto;
}
.slide-zoom {
text-align: center;
position: absolute;
top: 0;
display: block;
width: 100%;
height: auto;
padding: 50px 10px;
}
Nothing worked for me
this worked for me on slides with different heights
.swiper-slide {
display: block;
}
ion-slide{
ion-list{
height: 90vh; // padding for footer
overflow-y: scroll;
}
}
.swiper-slide{ overflow-y: scroll; display: block; }
ion-slide{ height: auto; }
Worked for slides of variable lengths.
Now, ion-refresher is not working properly. It gets refreshed every time I scroll to down even if there are more items in the list.
Thanks for the issue! We have moved the source code and issues for Ionic 3 into a separate repository. I am moving this issue to the repository for Ionic 3. Please track this issue over there.
Thank you for using Ionic!
Issue moved to: https://github.com/ionic-team/ionic-v3/issues/43