Skip to content

Commit 5300e47

Browse files
authored
fix: totalSize should be paddingStart + paddingEnd when size is 0 (#238)
1 parent bc21ad1 commit 5300e47

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export function useVirtual({
104104
return measurements
105105
}, [estimateSize, measuredCache, paddingStart, size, keyExtractor])
106106

107-
const totalSize = (measurements[size - 1]?.end || 0) + paddingEnd
107+
const totalSize = (measurements[size - 1]?.end || paddingStart) + paddingEnd
108108

109109
latestRef.current.measurements = measurements
110110
latestRef.current.totalSize = totalSize

0 commit comments

Comments
 (0)