Skip to content
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

Difference in behaviour of OptionList.add_options in Textual v2.0 #5539

Closed
davep opened this issue Feb 16, 2025 · 1 comment · Fixed by #5540
Closed

Difference in behaviour of OptionList.add_options in Textual v2.0 #5539

davep opened this issue Feb 16, 2025 · 1 comment · Fixed by #5540

Comments

@davep
Copy link
Contributor

davep commented Feb 16, 2025

Previously this code:

from textual.app import App, ComposeResult
from textual.widgets import OptionList

class OptionListBugApp(App[None]):

    def compose(self) -> ComposeResult:
        yield OptionList()

    def on_mount(self) -> None:
        self.query_one(OptionList).add_options(f"Option {n}" for n in range(100))

if __name__ == "__main__":
    OptionListBugApp().run()

would result in a populated OptionList. As of v2.0.0 it now results in an unpopulated OptionList.

Copy link

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant