ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

Infinite Scrolling combined with ion-scroll issues

Open mhartington opened this issue 12 years ago • 4 comments

When using an infinite scroll along with a horizontal scroll, on-infinite keeps running and loading new data.

See codepen here http://codepen.io/mhartington/pen/Jehlz

From the forum http://forum.ionicframework.com/t/infinite-scrolling-for-horizontal-scroll/2694/3

mhartington avatar Apr 07 '14 16:04 mhartington

Good catch - infinite scroll only detects vertical scroll right now; whoops :-)

ajoslin avatar Apr 09 '14 13:04 ajoslin

Fixed!

From the commit message:

ion-infinite-scroll will now fire infinite scroll if the user scrolls past the left boundaries (if they exist) or the top boundaries (if they exists). This means infinite scroll works for vertical, horizontal, or vertical plus horizontal scrolling situations.

ajoslin avatar Apr 09 '14 13:04 ajoslin

@ajoslin , if we have a vertically and horizontally scrollable content, on-infinite runs for both, but if we only want it to run only on vertical scrollin this is a problem. My sugestion is to have two attrs on ion-infinite-scroll like : 'not-on-horizontal' and 'not-on-vertical'

And in ionInfiniteScroll directive code:

(...) if ((maxScroll.left !== -1 && scrollValues.left >= maxScroll.left && $attrs.notOnHorizontal !=="true") || (maxScroll.top !== -1 && scrollValues.top >= maxScroll.top && $attrs.notOnVertical !=="true")) { onInfinite(); }

Do you think I should open a pull request?

PedroJusto avatar Oct 29 '14 15:10 PedroJusto

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

ionitron-bot[bot] avatar Sep 06 '18 16:09 ionitron-bot[bot]