Only refresh on deselect if something was deselected

This commit is contained in:
Dave Pearson
2023-05-23 10:35:48 +01:00
parent d861cced97
commit ff404e2bbf

View File

@@ -302,11 +302,11 @@ class SelectionList(Generic[SelectionType], OptionList):
Args: Args:
selection: The selection to mark as selected. selection: The selection to mark as selected.
""" """
self._deselect( if self._deselect(
selection.value selection.value
if isinstance(selection, Selection) if isinstance(selection, Selection)
else cast(SelectionType, selection) else cast(SelectionType, selection)
) ):
self.refresh() self.refresh()
return self return self