[GH-ISSUE #954] Undesirable List Behavior #700

Closed
opened 2026-03-04 01:07:07 +03:00 by kerem · 1 comment
Owner

Originally created by @Souheab on GitHub (Mar 7, 2024).
Original GitHub issue: https://github.com/rivo/tview/issues/954

For the following code:

	list := tview.NewList().
		AddItem("hello", "", 0, nil ).
		AddItem("World","" , 0, nil ).
		AddItem("!","" , 0, nil ).
		AddItem("qwertyiopasdfghjkl;","" , 0, nil ).
		ShowSecondaryText(false).
		SetHighlightFullLine(true).
		SetSelectedStyle(tcell.StyleDefault.Reverse(true).Foreground(tcell.ColorBlue))

The rendered list looks like this:

image

It seems that the selected style with the reversed attribute set to true is only being applied to the mainText portion of the list, I would like the given style to be applied to the full line instead of just the mainText

Originally created by @Souheab on GitHub (Mar 7, 2024). Original GitHub issue: https://github.com/rivo/tview/issues/954 For the following code: ```go list := tview.NewList(). AddItem("hello", "", 0, nil ). AddItem("World","" , 0, nil ). AddItem("!","" , 0, nil ). AddItem("qwertyiopasdfghjkl;","" , 0, nil ). ShowSecondaryText(false). SetHighlightFullLine(true). SetSelectedStyle(tcell.StyleDefault.Reverse(true).Foreground(tcell.ColorBlue)) ``` The rendered list looks like this: ![image](https://github.com/rivo/tview/assets/85948717/ef622d34-f1d3-48eb-8187-b6fa2436847e) It seems that the selected style with the reversed attribute set to true is only being applied to the `mainText` portion of the list, I would like the given style to be applied to the full line instead of just the `mainText`
kerem closed this issue 2026-03-04 01:07:08 +03:00
Author
Owner

@rivo commented on GitHub (Apr 3, 2024):

Thanks for reporting this. The latest commit should fix this issue.

See also https://github.com/rivo/tview/pull/960#issuecomment-2034676479

<!-- gh-comment-id:2034676801 --> @rivo commented on GitHub (Apr 3, 2024): Thanks for reporting this. The latest commit should fix this issue. See also https://github.com/rivo/tview/pull/960#issuecomment-2034676479
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#700
No description provided.