Force at least one item to always be initially rendered (#5029)

(cherry picked from commit d5a7618374)
This commit is contained in:
Hailey
2024-08-29 17:20:07 -07:00
parent 68b65f4732
commit 1b07502281
+6 -1
View File
@@ -15,5 +15,10 @@ export function useInitialNumToRender({
const finalHeight =
screenHeight - screenHeightOffset - topInset - bottomBarHeight
return Math.floor(finalHeight / minItemHeight) + 1
const minItems = Math.floor(finalHeight / minItemHeight)
if (minItems < 1) {
return 1
}
return minItems
}