Skip to content
Open
Show file tree
Hide file tree
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/VirtualizedList.js
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,9 @@ class VirtualizedList extends StateSafePureComponent<
} else {
// If we have a pending scroll update, we should not adjust the render window as it
// might override the correct window.
if (pendingScrollUpdateCount > 0) {
// We only block the update if the content is large enough to scroll, otherwise
// we might never receive a scroll event to clear the pending update.
if (pendingScrollUpdateCount > 0 && contentLength > visibleLength) {
return cellsAroundViewport.last >= getItemCount(data)
? VirtualizedList._constrainToItemCount(cellsAroundViewport, props)
: cellsAroundViewport;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4865,12 +4865,21 @@ exports[`renders new items when data is updated with non-zero initialScrollIndex
/>
</View>
<View
style={
Object {
"height": 20,
}
}
/>
onFocusCapture={[Function]}
style={null}
>
<MockCellItem
value={2}
/>
</View>
<View
onFocusCapture={[Function]}
style={null}
>
<MockCellItem
value={3}
/>
</View>
</View>
</RCTScrollView>
`;
Expand Down