-
Notifications
You must be signed in to change notification settings - Fork 814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OptionList does not persist highlighted options after it loses focus #3343
Comments
My memory is a wee bit hazy on this, but the However, if you want the effect you're looking for, you can add it to your app's CSS. Something like: OptionList > .option-list--option-highlighted {
background: $accent 40%;
}
OptionList:focus > .option-list--option-highlighted {
background: $accent;
} (or of course whatever fits your app's styling) |
Good spot! I suspected that PR but couldn't obviously see anything in the blame. I was off by 10% too. 🤷🏻♀️ Anyway, presumably a deliberate choice as part of that PR so the advice above should hold. |
The advice above does hold, I didn't need the focus one for it to work. I had an inkling that PR was the reason, glad we found the issue |
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
Haha, not bad only being off by 10%! If this was a deliberate choice, I'm not sure I agree with it... I actually had to double-check there wasn't a bug, as the bold styling really doesn't stand out (at least with my terminal/font). But also this doesn't seem consistent with other widgets like |
It's not quite to my taste either; I believe we do have an outstanding and overarching issue relating to conducting a wider review of styles as they pertain to widgets with some form of cursor or highlight. Hopefully it'll be settled with that. |
I recently upgraded to the latest textual in my project and for some reason my
OptionLists
when they lose focus don't keep the option highlighted if one was clicked while theOptionList
was in focus.I was on 0.27.0 before upgrading to this latest version of 0.36.0. I was able to replicate my problem using the code below and the following tcss file:
The screen shots below show my issue, I click the first
OptionList
and then go to the second one. As soon as the firstOptionList
loses focus it does not indicate anymore which option was highlighted previously by my click.I've confirmed if I query the
OptionList
it still says who was highlighted but for a GUI user it would be hard to know what was highlightedThe text was updated successfully, but these errors were encountered: