From 10fcaa56e713051f13387f86c585fff4c465af84 Mon Sep 17 00:00:00 2001 From: LucioChavezFuentes Date: Sun, 23 Oct 2022 11:45:01 -0500 Subject: [PATCH] prevent VirtualizedList to save offsets equal to zero if item is not the first item of list --- .../src/vendor/react-native/VirtualizedList/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/react-native-web/src/vendor/react-native/VirtualizedList/index.js b/packages/react-native-web/src/vendor/react-native/VirtualizedList/index.js index 180ec22ac..6c03d66e4 100644 --- a/packages/react-native-web/src/vendor/react-native/VirtualizedList/index.js +++ b/packages/react-native-web/src/vendor/react-native/VirtualizedList/index.js @@ -1323,6 +1323,14 @@ class VirtualizedList extends React.PureComponent { inLayout: true, }; const curr = this._frames[cellKey]; + + // Measures on discarded Low Priority updates will return zero for dimensions + // no cell should have an offset of zero on frames, except for first cell + if (next.offset === 0 && index !== 0) { + this._scheduleCellsToRenderUpdate(); + return; + } + if ( !curr || next.offset !== curr.offset ||