Skip to content

Commit

Permalink
Force at least one item to always be initially rendered (#5029)
Browse files Browse the repository at this point in the history
  • Loading branch information
haileyok authored Aug 30, 2024
1 parent 497aacf commit d5a7618
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib/hooks/useInitialNumToRender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit d5a7618

Please sign in to comment.