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

scroll to end now works when user wants to load in chunks. #2324

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

vinayenjapuri
Copy link

@vinayenjapuri vinayenjapuri commented Dec 5, 2023

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.

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.
@vinayenjapuri vinayenjapuri changed the title scroll to end is now works when user wants to load in chunks. scroll to end now works when user wants to load in chunks. Dec 5, 2023
@coveralls
Copy link

coveralls commented Jan 10, 2024

Coverage Status

coverage: 93.947%. remained the same
when pulling 3dea2f2 on vinayenjapuri:vinayenjapuri/scrollToEndIssue
into 3b5026f on ng-select:master.

Copy link

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 🎆

@github-actions github-actions bot added the stale label Mar 11, 2024
@github-actions github-actions bot closed this Mar 18, 2024
@pavankjadda pavankjadda reopened this Mar 18, 2024
@github-actions github-actions bot removed the stale label Mar 19, 2024
Copy link

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 🎆

@github-actions github-actions bot added the stale label May 18, 2024
@pavankjadda
Copy link
Collaborator

@vinayenjapuri I tried your fix. It is not working as expected

@pavankjadda pavankjadda added needs reproduction needs reproducible example and removed stale labels May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs reproduction needs reproducible example
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants