mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Add a method for deselecting all options
This commit is contained in:
@@ -302,6 +302,10 @@ class SelectionList(Generic[SelectionType], OptionList):
|
|||||||
self.refresh()
|
self.refresh()
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
def deselect_all(self) -> Self:
|
||||||
|
"""Deselect all items."""
|
||||||
|
return self._apply_to_all(self._deselect)
|
||||||
|
|
||||||
def _toggle(self, value: SelectionType) -> None:
|
def _toggle(self, value: SelectionType) -> None:
|
||||||
"""Toggle the selection state of the given value.
|
"""Toggle the selection state of the given value.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user