mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Add a method of getting at the selected values
This commit is contained in:
@@ -182,6 +182,11 @@ class SelectionList(Generic[SelectionType], OptionList):
|
||||
)
|
||||
self._selected: dict[SelectionType, None] = {}
|
||||
|
||||
@property
|
||||
def selected(self) -> list[SelectionType]:
|
||||
"""The selected values."""
|
||||
return list(self._selected.keys())
|
||||
|
||||
def _make_selection(
|
||||
self,
|
||||
selection: tuple[TextType, SelectionType]
|
||||
|
||||
Reference in New Issue
Block a user