Force at least one item to always be initially rendered (#5029)
This commit is contained in:
parent
497aacf113
commit
d5a7618374
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue