From b1136632216e724e3e046a87f9b522a1f4bc901f Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Wed, 24 May 2023 12:55:31 +0100 Subject: [PATCH] Add a note about SelctionToggled vs SelectedChanged --- src/textual/widgets/_selection_list.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/textual/widgets/_selection_list.py b/src/textual/widgets/_selection_list.py index 0596fce22..c5b74748d 100644 --- a/src/textual/widgets/_selection_list.py +++ b/src/textual/widgets/_selection_list.py @@ -183,6 +183,14 @@ class SelectionList(Generic[SelectionType], OptionList): Can be handled using `on_selection_list_selection_toggled` in a subclass of `SelectionList` or in a parent node in the DOM. + + Note: + This message is only sent if the selection is toggled by user + interaction. See + [`SelectedChanged`][textual.widgets.SelectionList.SelectedChanged] + for a message sent when any change (selected or deselected, + either by user interaction or by API calls) is made to the + selected values. """ @dataclass