react-stay-scrolled icon indicating copy to clipboard operation
react-stay-scrolled copied to clipboard

Support for prepending items to list and keeping scroll

Open JakeSchroeder opened this issue 4 years ago • 2 comments

I am building a chat application where the user starts at the bottom of a list of messages and scrolls upward, infinitely loading items which in turn prepends them to the list.

Would this package support starting at the bottom and allowing a user to infinitely scroll upwards while maintaining their scroll position?

Similarly to Slack or Microsoft Teams?

Thanks for this awesome lib

JakeSchroeder avatar Jan 26 '21 08:01 JakeSchroeder

Hey!

If I understand correctly, the option you are looking for is initialScroll. I think this lib should be able to help with your usecase, but feel free to send me a PR if you find any shortcomings :)

perrin4869 avatar Jan 26 '21 08:01 perrin4869

I have exactly the same usecase. An example where the customer scrolls up to the top, then new messages are added, while the scrollbar position is maintained exactly where the customer was left, would be really appreciated.

ptahchiev avatar Feb 02 '24 23:02 ptahchiev