Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent VirtualizedList to save offsets equal to zero if item is not the first item of list (4th of 4 problems that cause #1254) #2415

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// no cell should have an offset of zero on frames, except for first cell
// no cell should have an offset of zero on frames, except for first cell,
// so if that's the case, re-schedule another update without saving the incorrect layout

if (next.offset === 0 && index !== 0) {
this._scheduleCellsToRenderUpdate();
return;
}

if (
!curr ||
next.offset !== curr.offset ||
Expand Down