mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[GH-ISSUE #193] Option to not highlight selected list element when not focused #153
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#153
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 @dimonomid on GitHub (Nov 23, 2018).
Original GitHub issue: https://github.com/rivo/tview/issues/193
Another thing is that the
Listprimitive always highlights selected item, and it also makes it hard to unselect all items. In my app I have a few lists, but I need to highlight their items only when the list is focused. My workaround is to useSetCurrentItem(-1), but it only works when the list is empty; otherwise it selects the last item. So, when I need to modify the list, I had toClearit first, then doSetCurrentItem(-1), and then add all items back. Ugh. :)Would you be open to implementing some option to avoid highlighting of selected element while the list is not focused?
@rivo commented on GitHub (Nov 26, 2018):
I added this with the latest commit. You'll need to call
list.SetSelectedFocusOnly(true).@dimonomid commented on GitHub (Nov 26, 2018):
Cool, thanks!