Flipkart / recyclerlistview

High performance listview for React Native and web!
Apache License 2.0
5.26k stars 429 forks source link

ListView is scrolling to bottom item after random item is updated #632

Open turkysha opened 3 years ago

turkysha commented 3 years ago

So basically listview is scrolling to bottom item after I update any item in list. I have chatapp with audio messages and each time slider changes value listview scrolls to item down. It happens even when I change play/pause button on click. So I figured out it scrolls on each item update, it really does not matter. If I click on message I update from play button icon to pause button icon that message and listview scrolls down. Can sameone help me understand why this happens? I found some dude suggested to put dataProvider in useState but I already have it. This is my dataProvider: const [dataProvider, setDataProvider] = useState(new DataProvider((r1,r2) => r1!==r2))

And I can reporduce issue with any state changes, for example: const [state, setState] = useState(false)

and in my rowrenderer for example: `return(

)`

I want to prevent from scrolling.

zchwyng commented 3 years ago

I'm having similar issues... Please post if you find any solution.