Fixed an infinite loop after clearing a selected cell. Fixes #944

pull/428/merge
Oliver 2 months ago
parent 5605142ca6
commit e350bef1f9

@ -1422,7 +1422,6 @@ func (t *Table) InputHandler() func(event *tcell.EventKey, setFocus func(p Primi
down = func() {
if t.rowsSelectable {
row, column := t.selectedRow, t.selectedColumn
t.selectedRow++
if t.selectedRow >= rowCount {
if t.wrapVertically {
@ -1431,6 +1430,7 @@ func (t *Table) InputHandler() func(event *tcell.EventKey, setFocus func(p Primi
t.selectedRow = rowCount - 1
}
}
row, column := t.selectedRow, t.selectedColumn
finalRow, finalColumn := rowCount-1, lastColumn
if t.wrapVertically {
finalRow = row
@ -1447,7 +1447,6 @@ func (t *Table) InputHandler() func(event *tcell.EventKey, setFocus func(p Primi
up = func() {
if t.rowsSelectable {
row, column := t.selectedRow, t.selectedColumn
t.selectedRow--
if t.selectedRow < 0 {
if t.wrapVertically {
@ -1456,6 +1455,7 @@ func (t *Table) InputHandler() func(event *tcell.EventKey, setFocus func(p Primi
t.selectedRow = 0
}
}
row, column := t.selectedRow, t.selectedColumn
finalRow, finalColumn := 0, 0
if t.wrapVertically {
finalRow = row

Loading…
Cancel
Save