mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 13:25:51 +03:00
[GH-ISSUE #683] The default behavior of (*Table).Select is broken #500
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#500
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 @darkhz on GitHub (Dec 28, 2021).
Original GitHub issue: https://github.com/rivo/tview/issues/683
(*Table).Select would select rows/columns that are outside the visible area by default.
However, after the introduction of virtual tables(78cf54e8302c30a568db07a52ec85b77e44eb469), this behavior is broken. When attempting to select cells that are outside the visible area, the table does not automatically scroll to the selection.
I traced the problem to line 872 in table.go.
clampToSelectionis always false when evaluatingt.clampToSelection && t.rowsSelectable, therefore the resulting code block does not execute and the table is not scrolled according to the selection.The following code will demonstrate this issue. Revert and re-add
78cf54e830to see the difference in behaviors.@rivo commented on GitHub (Feb 15, 2022):
This was not so much about virtual tables but rather something I needed to do for #618.
I made a change that will turn on clamping when
Table.Select()is called.