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

Can't dynamically change infiniteScrollUpDistance #364

Open
3 tasks
madmacc opened this issue Sep 8, 2020 · 2 comments
Open
3 tasks

Can't dynamically change infiniteScrollUpDistance #364

madmacc opened this issue Sep 8, 2020 · 2 comments

Comments

@madmacc
Copy link

madmacc commented Sep 8, 2020

Expected Behavior

I assign a variable called "infiniteScrollUpDistance" to infiniteScrollUpDistance that has the value 6 then I change this to 1 in the .ts file as more items are loading into the list.
The value of infiniteScrollUpDistance should change from 6 to 1 and start loading items when the scrollbar is at 90% rather than 40%.

 <div #chatRoomContainer
      infinite-scroll
      [infiniteScrollContainer]="chatRoomContainer"
      [infiniteScrollUpDistance]="infiniteScrollUpDistance"
      [infiniteScrollThrottle]="10"
      (scrolled)="onScrollDown()"
      (scrolledUp)="onScrollUp()">

Actual Behavior

It keeps behaving as if it is 6 rather than 1 e.g. loading more items at 40% of the scroll height. Changing the value of the variable does not seem to do anything after the it gets the initial value.

Context

I want the scroll to be load early as soon as the user scrolls up when there are not many items in the list and then as the list becomes longer e.g 60 plus items I only want to load more items once the user is near the end of the list e.g. last 10%.
Basically I want to load when the user only has 10-20 items left to scroll up and see.
I am setting it at 6 to start to try and avoid this issue here: #355

Your Environment

  • Version used: 9.0.0
  • Browser Name and version: Chrome Version 85.0.4183.83 (Official Build) (64-bit)
  • (Optional) Operating System and version (desktop or mobile): Windows 10
@orizens
Copy link
Owner

orizens commented Dec 2, 2020

@madmacc can you reproduce the issue with a sandbox?

@madmacc
Copy link
Author

madmacc commented Dec 3, 2020

@orizens I will try to do so when I have some time. It may be a couple of weeks away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants