textual icon indicating copy to clipboard operation
textual copied to clipboard

`SelectionList.select` doesn't post `SelectionToggled` message

Open TomJGooding opened this issue 1 year ago • 1 comments

Alright, now I know where I went wrong: When looking into textual's code again I found out that SelectionList.toggle triggers the event while SelectionList.select does not. I only tried out SelectionList.select before :(

Originally posted by @jvllmr in https://github.com/Textualize/textual/discussions/4397#discussioncomment-9031924

TomJGooding avatar Apr 07 '24 09:04 TomJGooding

We found the following entries in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

This is an automated reply, generated by FAQtory

github-actions[bot] avatar Apr 07 '24 09:04 github-actions[bot]

Looking at this now.

Spotted a couple of issues relating to the messages in SelectionList, so going to do a pass over it and try to make sure it's posting the right stuff from the various different methods it offers.

darrenburns avatar Jul 16 '24 12:07 darrenburns

I actually believe this is just some lacking documentation.

The semantics of toggle is just that it was explicitly toggled i.e. using the keyboard or a toggle call. The original poster is just handling the wrong event.

I've made the semantics clearer inside docstrings (and also ensured that Toggled messages are sent when toggle_all is used).

Related PR: https://github.com/Textualize/textual/pull/4759

darrenburns avatar Jul 16 '24 13:07 darrenburns

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

github-actions[bot] avatar Jul 16 '24 13:07 github-actions[bot]