recyclerlistview icon indicating copy to clipboard operation
recyclerlistview copied to clipboard

onEndReached causes list teleportation

Open isinuyk opened this issue 3 years ago • 4 comments

I'm trying to implement RecycleListView instead of default FlatList in my chat component. Also, I'm using react-native-text-size to calculate text message height. Everything works well. But when I tried to implement the fetchMore feature using onEndReached from the RecycleListView I faced one problem. When I got new messages my list teleports down a little and scrolling stops.

https://user-images.githubusercontent.com/72970722/124729276-f7879880-df18-11eb-8197-aa9745153b05.mov

The only thing that I understood it happens when I recreate LayoutProvider with the new messages.

image initFlatHeights() function fires everytime when I got new messages

isinuyk avatar Jul 07 '21 08:07 isinuyk

Facing the same issue

Orange9000 avatar Sep 22 '21 14:09 Orange9000

In my case, it was because I had layoutProvider inside render(). Fixed it by moving layoutProvider to constructor.

Orange9000 avatar Sep 22 '21 17:09 Orange9000

layoutProvider

Working fine, I am using functional component and moved layoutProvider outside of function

vijaychouhan-rails avatar Oct 16 '21 16:10 vijaychouhan-rails

remove setLayoutProvider. If you have a loading view, you should not remove it until there is no more data

Only-IceSoul avatar Nov 06 '21 05:11 Only-IceSoul