Open TomJGooding opened 4 days ago
When the Select widget is first expanded, the initial selected value is out of view when it appears further down in the list of options.
Select
from textual.app import App, ComposeResult from textual.widgets import Select class SelectApp(App): def compose(self) -> ComposeResult: yield Select.from_values( range(20), value=15, ) if __name__ == "__main__": app = SelectApp() app.run()
Thank you for your issue. Give us a little time to review it.
PS. You might want to check the FAQ if you haven't done so already.
This is an automated reply, generated by FAQtory
I think the problem is when the Select is first expanded, where this calls OptionList.scroll_to_highlight the region values here are all zeros:
OptionList.scroll_to_highlight
https://github.com/Textualize/textual/blob/8d99130708b3a862fc849884e0015c2c864345d1/src/textual/widgets/_option_list.py#L891-L896
When the
Select
widget is first expanded, the initial selected value is out of view when it appears further down in the list of options.