Shopify / flash-list

A better list for React Native
https://shopify.github.io/flash-list/
MIT License
5.38k stars 277 forks source link

Wrong video frame loaded when scrolling (need to wait a little for the correct video to load) #847

Open ShravanMeena opened 1 year ago

ShravanMeena commented 1 year ago

Current behavior

I have a flashlist of View elements, which display information about the products (name). While scrolling the wrong videos of the items are shown. Only after waiting a little bit, the correct video replace the wrong ones, and everything looks as it's supposed to look.

I shared behaviour video here

https://github.com/Shopify/flash-list/assets/41790742/742254b2-9453-430b-9f8d-23d38b44117a

Expected behavior

Scrolling should not affect how video are displayed: each corresponding video should be displayed correctly.

To Reproduce

https://github.com/ShravanMeena/flashlist-POC

Platform:

Environment

"@shopify/flash-list": "^1.4.3",

Need Help 😭

oguzydz commented 1 year ago

same with photo

swikars1 commented 1 year ago

This is because of the internal implementation of the flashlist. I fixed it by using thumbnailUrl as key prop in the parent of the render item. Does the job foe me but obviously you'll loose flashlist's performance.

ShravanMeena commented 1 year ago

This is because of the internal implementation of the flashlist. I fixed it by using thumbnailUrl as key prop in the parent of the render item. Does the job foe me but obviously you'll loose flashlist's performance.

I have already did same.but after adding key to parents loose recycling or performance

timotismjntk commented 1 year ago

Yeah it's expected behavior, because it's recycled the previous cell

pacehutt commented 1 month ago

that's literally creating bad user experience