Skip to content
Open
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
4 changes: 3 additions & 1 deletion packages/virtualized-lists/Lists/ViewabilityHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,10 @@ class ViewabilityHelper {
) => ViewToken,
) {
// Filter out indices that have gone out of view since this call was scheduled.
// Use a Set so the lookup is O(1) per index instead of O(n) (`includes`).
const currentViewableIndices = new Set(this._viewableIndices);
viewableIndicesToCheck = viewableIndicesToCheck.filter(ii =>
this._viewableIndices.includes(ii),
currentViewableIndices.has(ii),
);
const prevItems = this._viewableItems;
const nextItems = new Map(
Expand Down
Loading