Fix UI freeze when pressing Down in an empty table
tview's table navigation never terminates when no row is selectable. Turn selection off while the Downloads panels and the release list are empty. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -293,10 +293,14 @@ func fill(t *tview.Table, expand int, rows [][]string) {
|
||||
// shows placeholder text when there are no rows.
|
||||
func restoreSelection(t *tview.Table, n, selRow int, placeholder string) {
|
||||
if n == 0 {
|
||||
// With no selectable row, tview's Down/Up handling never terminates,
|
||||
// so turn selection off entirely.
|
||||
t.SetCell(1, 0, tview.NewTableCell("[gray]"+placeholder).SetSelectable(false))
|
||||
t.SetSelectable(false, false)
|
||||
t.Select(0, 0)
|
||||
return
|
||||
}
|
||||
t.SetSelectable(true, false)
|
||||
t.Select(max(selRow, 1), 0)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user