Skip to content

Commit

Permalink
prevent VirtualizedList to save offsets equal to zero if item is not …
Browse files Browse the repository at this point in the history
…the first item of list
  • Loading branch information
LucioChavezFuentes committed Oct 23, 2022
1 parent dee258a commit 10fcaa5
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1323,6 +1323,14 @@ class VirtualizedList extends React.PureComponent<Props, State> {
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 ||
Expand Down

0 comments on commit 10fcaa5

Please sign in to comment.