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

How to preventing scrolling to the bottom after new elements are inserting inside a list? #403

Open
ntovr opened this issue Oct 5, 2021 · 0 comments

Comments

@ntovr
Copy link

ntovr commented Oct 5, 2021

Hi everyone! In my case, I use onScrollFrame and wait until the user will scroll to the top of the list and after that, I make an async request to load more messages from the server (kinda lazy loading for supporting a massive amount of messages) but when I add new messages to the list (they are added to the top of the list), it scrolls to the bottom. How can I prevent it? I have an idea to calculate the difference between scroll heights using getScrollHeight before and after each loading but I hardly know where to begin. Do you have any ideas or is there any other way to go? Maybe some ready cases? I don't think I'm the first guy who is trying to do something like that. Thanks in advance.

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