internal/ui/list/list.go 🔗
@@ -84,6 +84,10 @@ func (l *List) AtBottom() bool {
// Calculate the height from offsetIdx to the end.
var totalHeight int
for idx := l.offsetIdx; idx < len(l.items); idx++ {
+ if totalHeight > l.height {
+ // No need to calculate further, we're already past the viewport height
+ return false
+ }
item := l.getItem(idx)
itemHeight := item.height
if l.gap > 0 && idx > l.offsetIdx {