Skip to content

Commit 7fc854f

Browse files
themelertangbc
authored andcommitted
Always render all slots
List height is determined by item height and visible items number (`remain` prop) and this works flawless as long as this number is {Integer}. But... when `remain` prop is set dynamically to {Float} (for ex.: list fills all available vertical space in UI), last item in scrollable list won't be rendered (for ex.: `delta.end' can equal `58.6` for `59` items, so only 58 slots are rendered). This solution fixes the problem.
1 parent 6d71b9d commit 7fc854f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@
318318
delta.offsetAll = allHeight - this.size * this.remain
319319

320320
var targets = []
321-
for (var i = delta.start; i <= delta.end; i++) {
321+
for (var i = delta.start; i <= Math.ceil(delta.end); i++) {
322322
targets.push(slots[i])
323323
}
324324
return targets

0 commit comments

Comments
 (0)