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.
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 usinggetScrollHeight
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.