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.
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.