Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite Scrolling combined with ion-scroll issues #1073

Closed
mhartington opened this issue Apr 7, 2014 · 4 comments
Closed

Infinite Scrolling combined with ion-scroll issues #1073

mhartington opened this issue Apr 7, 2014 · 4 comments

Comments

@mhartington
Copy link
Contributor

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

@ajoslin
Copy link
Contributor

ajoslin commented Apr 9, 2014

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

@ajoslin ajoslin self-assigned this Apr 9, 2014
@ajoslin ajoslin closed this as completed in d58fff7 Apr 9, 2014
@ajoslin
Copy link
Contributor

ajoslin commented Apr 9, 2014

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 added a commit that referenced this issue Apr 12, 2014
Fixes #1073

ion-infinite-scroll will now fire a scroll event 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.
@PedroJusto
Copy link

@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?

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 6, 2018

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 ionitron-bot bot locked and limited conversation to collaborators Sep 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants