-
-
Notifications
You must be signed in to change notification settings - Fork 1k
fix: add set_options to SelectionList #6224
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
base: main
Are you sure you want to change the base?
fix: add set_options to SelectionList #6224
Conversation
threw me off when this happened to rovr, because the self._selected never got cleared when `set_options` was used instead of `clear_options` + `add_options`
waiting for a new release that has Textualize/textual#6224 merged
TomJGooding
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure this is correct? You can build a SelectionList with tuples or Selection objects, but here it looks like you're trying to use SelectionType?
not really sure which one to use, given that |
|
I'm confused, Did you check your code actually worked, or just throw the PR over the wall? |
|
The general code worked, but I'm not sure about which class to use as the type hint for the function |
|
Sorry, I think I understand the problem now. I thought the signature would just be similar to the textual/src/textual/widgets/_selection_list.py Lines 629 to 637 in 422852a
But of course this doesn't satisfy mypy and friends for I realise now that I overlooked that this actually ends up calling |
threw me off when this happened to rovr, because the self._selected never got cleared when
set_optionswas used instead ofclear_options+add_optionsPlease review the following checklist.