Add a method for deselecting all options

This commit is contained in:
Dave Pearson
2023-05-23 10:22:01 +01:00
parent 3ce04c814a
commit a4148d028b

View File

@@ -302,6 +302,10 @@ class SelectionList(Generic[SelectionType], OptionList):
self.refresh()
return self
def deselect_all(self) -> Self:
"""Deselect all items."""
return self._apply_to_all(self._deselect)
def _toggle(self, value: SelectionType) -> None:
"""Toggle the selection state of the given value.