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

Current slice of visible items change on prepending items off-screen #507

Open
soletan opened this issue Aug 16, 2021 · 0 comments
Open

Comments

@soletan
Copy link

soletan commented Aug 16, 2021

According to README the scroller keeps current slice of items visible in case of prepending items. However, this didn't work for me due to increasing bufferAmount attribute.

See this project for illustration:
https://stackblitz.com/edit/angular-ivy-nblxir

If you populate the list, scroll down a bit and click on item visible at the very top while holding Ctrl- and Alt-key, the actually clicked item gets pushed down for scrolling offset isn't adjusted after having prepended items.

After digging into the code I found that the related code is focusing on first item currently in DOM to stay first item in DOM, which is different from first visible item staying first visible item. Thus, this issue isn't reproducible unless increasing bufferAmount attribute's value from 2 to e.g. 10.

Following this observation I tried fixing the issue. See the related PR (which is affecting some issues I was having on setting up my IDE and getting rid of linter issues).

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

1 participant