@@ -336,8 +336,7 @@ func (l *List) ScrollToBottom() {
337 // Scroll to the last item
337 // Scroll to the last item
338 var totalHeight int
338 var totalHeight int
340− for i = len(l.items) - 1; i >= 0; i-- {
339+ for i := len(l.items) - 1; i >= 0; i-- {
341 item := l.getItem(i)
340 item := l.getItem(i)
342 totalHeight += item.height
341 totalHeight += item.height
343 if l.gap > 0 && i < len(l.items)-1 {
342 if l.gap > 0 && i < len(l.items)-1 {
@@ -349,10 +348,9 @@ func (l *List) ScrollToBottom() {
352− if i < 0 {
351+ if totalHeight < l.height {
353 // All items fit in the viewport
352 // All items fit in the viewport
354− l.offsetIdx = 0
353+ l.ScrollToTop()