mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[GH-ISSUE #842] table.SetWrapSelection(true, false) always set selectedRow to 0 even if the first row is not selectable #614
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#614
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 @quantonganh on GitHub (Apr 21, 2023).
Original GitHub issue: https://github.com/rivo/tview/issues/842
Hi,
As the title says, if we enable vertically wrapping selections, on the UI, it jump from the last selectable row to the first selectable row, but
selectedRowis always set to 0 even if the first row is not selectable.You can reproduce by running something like this:
I think that we have a bug here: https://github.com/rivo/tview/blob/master/table.go#L1445
@quantonganh commented on GitHub (Apr 21, 2023):
Btw, if we have some header rows (that cannot be selected) as the above example, then vertically wrapping selections won't jump from first selectable row to the last selectable row, because this condition never happens: https://github.com/rivo/tview/blob/master/table.go#L1463
@rivo commented on GitHub (Jun 18, 2023):
Thanks for letting me know. This was much harder to do right than I initially thought. The latest commit should fix it. Let me know in case you still find a bug in there somewhere.