-
Notifications
You must be signed in to change notification settings - Fork 27
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
Handle starting from a random point in the bidirectional-list #21
Comments
Yes, I did The prop name can be a bit ambiguous when used together with The short answer is (for an inverted list) you will be on message Here's how
https://getstream.github.io/react-native-bidirectional-infinite-scroll/props#enableautoscrolltotop |
Actually here's a prop that I've stumbled on: https://reactnative.dev/docs/virtualizedlist#initialscrollindex
It should probably do the trick, but requires |
I'm not sure if this is handled or this is the expected behavior - start the bidirectional list from a random point
The scroll position is always on the last item when the list is inverted
Let's say we have a chat with 1000 messages and we load chunks of 25 at a time
Let's say we want to start from message 500
Here's what we do ATM (we use an
inverted
bidirectional-infinite-scroll
)indexOf
message 500onStartReached
which is OK and loads messages above 500 (475 - 500)The problem is, since that messages are complex we don't use
getItemLayout
and have to wait for the items to be rendered before scrolling, which causes a bad UXIdeally we want to be anchored on message 500 when we load past data
When we use a non-inverted list this seems to work OK as scroll position is naturally top to bottom and we're on the top
Which brings the question - why use the
inverted
prop at all?The explanation is that most chat apps prefer it that way, but isn't a bidirectional list solving this problem - you can easily add message at the begging as well as at the end
The text was updated successfully, but these errors were encountered: