File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed
src/components/infinite-scroll Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -135,6 +135,16 @@ export class InfiniteScroll {
135
135
}
136
136
}
137
137
138
+ /**
139
+ * @input {boolean} Whether or not the infinite scroll should be
140
+ * enabled or not. Setting to `false` will remove scroll event listeners
141
+ * and hide the display.
142
+ */
143
+ @Input ( )
144
+ set enabled ( shouldEnable : boolean ) {
145
+ this . enable ( shouldEnable ) ;
146
+ }
147
+
138
148
/**
139
149
* @output {event} The expression to call when the scroll reaches
140
150
* the threshold distance. From within your infinite handler,
@@ -221,6 +231,9 @@ export class InfiniteScroll {
221
231
this . _setListeners ( shouldEnable ) ;
222
232
}
223
233
234
+ /**
235
+ * @private
236
+ */
224
237
_setListeners ( shouldListen : boolean ) {
225
238
if ( this . _init ) {
226
239
if ( shouldListen ) {
Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ export class E2EPage1 {
29
29
30
30
if ( this . items . length > 90 ) {
31
31
this . enabled = false ;
32
- infiniteScroll . enable ( this . enabled ) ;
33
32
}
34
33
} ) ;
35
34
}
@@ -40,7 +39,6 @@ export class E2EPage1 {
40
39
41
40
toggleInfiniteScroll ( ) {
42
41
this . enabled = ! this . enabled ;
43
- this . infiniteScroll . enable ( this . enabled ) ;
44
42
}
45
43
}
46
44
Original file line number Diff line number Diff line change 23
23
</ button >
24
24
</ ion-list >
25
25
26
- < ion-infinite-scroll (ionInfinite) ="doInfinite($event) " threshold ="100px ">
26
+ < ion-infinite-scroll (ionInfinite) ="doInfinite($event) " [enabled] =" enabled " threshold ="100px ">
27
27
< ion-infinite-scroll-content
28
28
loadingSpinner ="bubbles "
29
29
loadingText ="Loading more data... ">
You can’t perform that action at this time.
0 commit comments