Replies: 2 comments 2 replies
-
The current selections are always exposed in the event, and the widget themselves. Typically via a reactive attribute. https://textual.textualize.io/widgets/selection_list/#reactive-attributes |
Beta Was this translation helpful? Give feedback.
-
Thanks! Indeed. However, there is only the highlighting( i.e. the current position of the cursor/selector) and not the latest selection (i.e. where the user clicked, pressed enter). And influences what kind of event one can choose to track the state of the app across several widget (see the example in the origianal post). I'm still puzzled if it is a choice or an overlooked feature. |
Beta Was this translation helpful? Give feedback.
-
I have discovered
textual
only a week ago. But thanks - it's a wonderful product!Trying it out I have noticed, that several widgets (e.g. datatable, option list) can emmit messages about both selection as well as highlighting, however, at the first glace it would seem that only highlighting is tracked in the object state, which makes the selection less useful practically.
Consider an app, where the user would first select a city from an option list, this will populate an another option list with street names. Upon selection the streen the user wants to click a button to send the composed address (city + street). However, there seems no reliable mechanism to read off the city and street selection (The user might inbetween change the highlighted city without selecting it).
Is it an overlooked feature? Or was it a design choice?
Beta Was this translation helpful? Give feedback.
All reactions