Allow setting selection for DetailedList
- Dominant language
- Python
- Stars
- 5.4k
- Forks
- 827
- Avg merge
- 9h 45m
- Merged PRs (30d)
- 58
Description
### What is the problem or limitation you are having?
I was working on an app with a DetailedList and needed to rearrange some items. I added a few buttons to move around selected items by removing them from the ListSource and re-inserting them.
The problem arose when I tried to get them re-selected. The DetailedList interface has the "selected" attribute that represents which row is selected, but unlike the Selection widget, it cannot be written to select a row from the list.
### Describe the solution you'd like
Add a setter for DetailedList.selection similar to Selection.value.
### Describe alternatives you've considered
DetailedList could have a method to select a row.
### Additional context
Related:
* https://github.com/beeware/toga/issues/2702
Contributor guide
Research direction
Start at the DetailedList entry point and compare its read-only selection behavior with Selection.value. Implement an assignable DetailedList.selection consistent with that comparison, and consider the related issue #2702; done means callers can re-select rows after removing and reinserting items.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- desktop
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100