Open vincentvella opened 1 year ago
:warning: | Newer Version of React Native is Available! |
---|---|
:information_source: | You are on a supported minor version, but it looks like there's a newer patch available - 0.71.10. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases. |
Confirmed this is still an issue on the latest release.
Confirming issue is not fixed on 0.72.4
Commenting so this doesn't get marked as stale
Commenting so this doesn't get marked as stale
@vincentvella FYI: Issues labelled with "Issue: Author Provided Repro" never get stale
Description
Nested Bidirectional FlatList onViewableItemsChanged Issue
The above images describe the layout where this problem has arisen. Essentially it's a 2D FlatList.
When the Vertical FlatList mounts and the onViewableItemsChanged prop callbacks fire for only the elements on the screen, the expected behavior is working.
However, once the nested FlatLists mount, instead of firing the onViewableItemsChanged callback for only the nested Horizontal FlatList items that are within the visible viewport, it fires for all rendered list items (including those that are out of the viewport). It seems that the correct viewability is determined on horizontal lists, however, the VirtualizedList doesn't check if those horizontal lists are vertically visible.
Below, I've illustrated the expected vs actual behavior with images/emojis
🎇 - Vertical FlatList onViewableItemsChanged callback fires 🔥 - Horizontal FlatList onViewableItemsChanged callback fires
I provided a minimum setup repo below you can clone. Only changed the App.tsx file to recreate the above steps.
React Native Version
0.71.0
Output of
npx react-native info
Steps to reproduce
Snack, code example, screenshot, or link to a repository
Taken from the tester app See that InnerViewable shows "56,57,58" All of which are horizontally viewable but not vertically shown in the viewport
Snack: https://snack.expo.dev/@vincentvella/great-almond Repo: https://github.com/vincentvella/bidirectional-virtualized-list-issue