You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(infinitescroll): always check on scroll change
Previously infinite scroll would only do checks when it got to
scrollTop it’s never seen before. However, this then requires a reset()
function if the underlying data changes, which would become an API
gotcha that would be a common source of problems for developers. Always
checking on scroll change should have little performance impact since
it was always checking while scrolling down anyway, it just wasn’t
checking when scrolling up. Now it always checks.
Copy file name to clipboardExpand all lines: ionic/components/infinite-scroll/infinite-scroll.ts
+3-11Lines changed: 3 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -168,12 +168,6 @@ export class InfiniteScroll {
168
168
169
169
letd=this._content.getContentDimensions();
170
170
171
-
if(d.scrollTop<=this._highestY){
172
-
// don't bother if scrollY is less than the highest Y seen
173
-
return4;
174
-
}
175
-
this._highestY=d.scrollTop;
176
-
177
171
letreloadY=d.contentHeight;
178
172
if(this._thrPc){
179
173
reloadY+=(reloadY*this._thrPc);
@@ -213,17 +207,15 @@ export class InfiniteScroll {
213
207
* trying to receive new data while scrolling. This method is useful
214
208
* when it is known that there is no more data that can be added, and
215
209
* the infinite scroll is no longer needed.
216
-
* @param {boolean} shouldEnable If the infinite scroll should be enabled or not. Setting to `false` will remove scroll event listeners and hide the display.
210
+
* @param {boolean} shouldEnable If the infinite scroll should be
211
+
* enabled or not. Setting to `false` will remove scroll event listeners
0 commit comments