mirror of
https://github.com/rivo/tview.git
synced 2026-04-27 13:55:51 +03:00
[GH-ISSUE #944] Changing selection on a cleared table can make the app unresponsive. #693
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#693
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @stijnveenman on GitHub (Feb 5, 2024).
Original GitHub issue: https://github.com/rivo/tview/issues/944
If we take the following example
We have row 0; which is not selectable (think of a header in a table)
And a few selectable rows. We can add rows by pressing
a, and clear withc.Expected
If we add a few rows this works fine, but if we click
cwe clear the table and create the (unselectable) header again. Then, we pressjto move to a different row, causing the selection to "change".After this, the app becomes unresponsive. Adding a new row with
adoes nothing.Even
ctr+cdoes not close the app anymore, and CPU jumps up to 100%.Side note: if i clear the table with row 2 (3th row) selected, and do not select a different row. And add a few rows again, i can see that row 2 is still selected. And the app stays responsive. It only happens when changing a row.
@F1bonacc1 commented on GitHub (Feb 5, 2024):
I attached a goroutine profiler. It looks like the table is stuck in this loop:
github.com/rivo/tview@861aa94d61/table.go (L1373)@rivo commented on GitHub (Mar 7, 2024):
Thank you. This should be fixed with the latest commit.