-
-
Couldn't load subscription status.
- Fork 1k
Closed
Description
This follows on from discussion #3559 about confusing errors when trying to remove options from a SelectionList.
It looks like parent OptionList widget was designed to always have a highlighted option based on the validation?
textual/src/textual/widgets/_option_list.py
Lines 987 to 992 in e68e6e3
| def validate_highlighted(self, highlighted: int | None) -> int | None: | |
| """Validate the `highlighted` property value on access.""" | |
| if not self._options: | |
| return None | |
| if highlighted is None or highlighted < 0: | |
| return 0 |
But if you start with an empty OptionList and then add options later, the highlighted reactive is still None which suggests this validation must not be called.
Metadata
Metadata
Assignees
Labels
No labels