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
scroll to end now works when user wants to load in chunks. #2324
base: master
Are you sure you want to change the base?
scroll to end now works when user wants to load in chunks. #2324
Conversation
scrollToEnd as per the README file, it was not working as expected. On scrolling to end in the first case, it is emitting scrollToEnd output event, afterwards, it stopped working. Reasons: Inside ngZone.run(), by docs, it triggers change detection. Not only that. As it will the emit the event. Change Detection will run first. Thus, before assigning _scrollToEndFired true, which is after ngZone.run() method, Angular runs the change detection. Expected, _scrollToEndFired to be true, and then get emitted. If there are any elements triggered, it will set _scrollToEndFired false in detection.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions 🎆 |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions 🎆 |
@vinayenjapuri I tried your fix. It is not working as expected |
scrollToEnd as per the README file, it was not working as expected. On scrolling to end in the first case, it is emitting scrollToEnd output event, afterwards, it stopped working.
Reasons:
Inside ngZone.run(), by docs, it triggers change detection. Not only that. As it will the emit the event. Change Detection will run first. Thus, before assigning _scrollToEndFired true, which is after ngZone.run() method, Angular runs the change detection. Expected, _scrollToEndFired to be true, and then get emitted. If there are any elements triggered, it will set _scrollToEndFired false in detection.