Programmatically selecting an item in List should set it up to be the next-focused item #4472
Open
2 tasks done
Labels
information-needed
Further information is requested
unverified
A bug that has been reported but not verified
Checklist
Describe the bug
If you create a list and then select a list item at the bottom for the user, then when they try to change to a new item in the list, it will jump back to the top of the list before selecting that item. This makes for a confusing UI experience, since no scroll should be needed (the item is visible).
The cause seems to be that the list item is not "focused" when we do list.Select(). So when the list itself is clicked - it resets to the focused item (0), then it focuses the item the user clicked on. We only set the focused item in the list when it is clicked - but shouldn't we also set it when we've selected that item for the user?
How to reproduce
list := NewList(...)
list.Select(id)
User then clicks an item in the list and it will adjust the scroll when its not necessary.
Screenshots
No response
Example code
list := NewList(...)
list.Select(id)
Fyne version
2.4.0
Go compiler version
1.19
Operating system and version
Windows 10
Additional Information
No response
The text was updated successfully, but these errors were encountered: