Closed
Description
Given this code:
from textual.app import App, ComposeResult
from textual.containers import Horizontal
from textual.widgets import ListView, ListItem, Label
class ListViewHoverIssueApp(App[None]):
def compose(self) -> ComposeResult:
yield ListView(
*[ListItem(Horizontal(Label(f"Item {n}"))) for n in range(100)]
)
if __name__ == "__main__":
ListViewHoverIssueApp().run()
note that the :hover
highlight only appears when the mouse is hovered over the "empty" part of the item in the list, not when over the text. The reason would seem to be:
ListItem > Widget :hover {
background: $boost;
}
in the code for ListItem
; which means that the background boost only happens when (in the case of the example code above) the mouse is over the Horizontal
, but not when it's over the Label
.