Ensure _options attribute is assigned in Select constructor (#2690)

* Ensure _options attribute is assigned in Select constructor

* Update CHANGELOG.md

---------

Co-authored-by: Will McGugan <willmcgugan@gmail.com>
This commit is contained in:
darrenburns
2023-05-31 09:45:06 +01:00
committed by GitHub
parent 149c39c86c
commit 0dc58bd151
2 changed files with 2 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Fixed zero division error https://github.com/Textualize/textual/issues/2673
- Fix `scroll_to_center` when there were nested layers out of view (Compositor full_map not populated fully) https://github.com/Textualize/textual/pull/2684
- Fix crash when `Select` widget value attribute was set in `compose` https://github.com/Textualize/textual/pull/2690
- Issue with computing progress in workers https://github.com/Textualize/textual/pull/2686
- Issues with `switch_screen` not updating the results callback appropriately https://github.com/Textualize/textual/issues/2650

View File

@@ -273,6 +273,7 @@ class Select(Generic[SelectType], Vertical, can_focus=True):
self.prompt = prompt
self._initial_options = list(options)
self._value: SelectType | None = value
self._options = options
def set_options(self, options: Iterable[tuple[RenderableType, SelectType]]) -> None:
"""Set the options for the Select.