Reputation: 123
I am developing an app in Ionic 3.2 version. I have a ion-refresher inside ion-scroll. I want to disable scrolling of ion-content
and want to show the ion-refresher
inside the ion-scroll
when scroll the ion-list
. But it fails.
no-bounce
(<ion-content no-bounce>
) and disable-scroll
(<ion-content disable-scroll>
) but still content is scrolling ion-fixed
inside content
and inside a div
just below the content
. But then the ion-refresher
not working.scroll="false"
(like in ionic 1.0) but still scrollingBelow the code;
<ion-content scroll="false">
<ion-scroll scrollY="true" style="width: 100% !important;height:30% !important">
<ion-refresher (ionRefresh)="fill_data($event)">
<ion-refresher-content pullingIcon="arrow-dropdown" pullingText="{{ 'pull_to_refresh' | translate }}" refreshingSpinner="circles"
refreshingText="{{ 'refreshing' | translate }}">
</ion-refresher-content>
</ion-refresher>
<ion-list>
//data filling here
</ion-list>
</ion-scroll>
</ion-content>
Please help me...
Upvotes: 6
Views: 22117
Reputation: 31
I have solved it. it's very simple.
ion-content > div.scroll-content {
overflow: hidden;
}
So it will be applied for only ion-content.
Upvotes: 0
Reputation: 11
use in the sass file of the page ..it works for me
.scroll-content {
left: 0;
right: 0;
top: 0;
bottom: 0;
position: absolute;
z-index: 1;
display: block;
overflow-x: unset;
overflow-y: unset;
-webkit-overflow-scrolling: touch;
will-change: scroll-position;
contain: size style layout;
}
Upvotes: 1
Reputation: 11
You can debug ios Ionic app using Safari, while debugging you can notice which is efficient.
.scroll-content {
overflow-y: hidden !important;
}
It will disable scrolling of ion-content and also disable scrolling of ion-list.
div.scroll-content {
bottom: 0px !important;
}
It is more efficient to disable scrolling of ion-content. It prevents only ion-content but ion-list
Upvotes: 0
Reputation: 914
.scroll-content {
overflow-y: hidden !important;
}
this worked for me
Upvotes: 2
Reputation: 72
Try below style code in your 'src\app\app.scss'
.scroll-content {
overflow-y: auto !important;
}
Upvotes: 0
Reputation: 1658
This is how I did it just now - same problem as you @Tony
With this SCSS my list scrolls, and I can have items below it:
page-home {
.scroll-content {
overflow: hidden;
}
ion-list {
overflow-y: auto;
max-height: 72vh;
}
}
I tried using the ionic scroll
and other options but none seem to work right now.
Upvotes: 3
Reputation: 2940
<ion-content>
<ion-grid>
<ion-row>
<ion-col>
<ion-scroll style="width:100%;height:100px" scrollY="true">
<ion-list scroll="true">
<ion-item *ngFor="let item of testData">
<div>{{item}}</div>
</ion-item>
</ion-list>
</ion-scroll>
</ion-col>
</ion-row>
</ion-grid>
<p>other data</p>
<ion-list>
<ion-item>
1
</ion-item>
<ion-item>
1
</ion-item>
<ion-item>
1
</ion-item>
</ion-list>
</ion-content>
andin .ts
file :
testData = [];
constructor(public navCtrl: NavController) {
for(let i =0;i<100;i++){
this.testData.push(i);
}
}
check this plunk
Upvotes: 0
Reputation: 542
Override the scroll-content, style
scroll-content {
overflow-y: auto;
}
i hope its work for you
Upvotes: 0