on main help sign in
fix(list): prevent panic due to negative index
1073723Andrey Nering
internal/ui/list/list.go+2
@@ -308,6 +308,8 @@ func (l *List) Render() string {
308 currentOffset = 0 // Reset offset for subsequent items
308 currentOffset = 0 // Reset offset for subsequent items
309 }
309 }
310
310
311+ l.height = max(l.height, 0)
312+
311 if len(lines) > l.height {
313 if len(lines) > l.height {
312 lines = lines[:l.height]
314 lines = lines[:l.height]
313 }
315 }