Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tabbing into a ListBox should always focus the selected item #11878

Closed
MrJul opened this issue Jun 23, 2023 · 0 comments · Fixed by #13826
Closed

Tabbing into a ListBox should always focus the selected item #11878

MrJul opened this issue Jun 23, 2023 · 0 comments · Fixed by #13826
Labels

Comments

@MrJul
Copy link
Member

MrJul commented Jun 23, 2023

Describe the bug
Tabbing into a ListBox should always focus the selected item.

To Reproduce
Use the Tab key to navigate into the ListBox in the control catalog's ListBoxPage.
Notice than even though Item 1 is the selected item, Item 0 get focused.
Latest master 714f88e

Expected behavior
The selected item is focused.

Scenarios

  • ❌ An item is selected before the items are realized. Tab focuses the first visible item instead of the selected item.
  • ✔ Select an item keep it into view. Tab focuses the selected item.
  • ❌ Select an item and scroll it out of view. Tab focuses either an incorrect recycled container or nothing instead of the selected item.
  • ❌ Bonus: same as above but with AutoScrollToSelectedItem disabled: since focusing the item isn't possible, it should probably focus the first visible item instead.

Related issue
#11846

@MrJul MrJul added the bug label Jun 23, 2023
grokys added a commit that referenced this issue Dec 4, 2023
grokys added a commit that referenced this issue Dec 4, 2023
github-merge-queue bot pushed a commit that referenced this issue Dec 5, 2023
* Add failing unit test for scenario 1 in #11878.

* Set TabOnceActiveElement on realized container.

Fixes scenario 1 in #11878.

* Use TabOnceActiveElement to decide focused element.

Fixes scenario #3 in #11878.
maxkatz6 pushed a commit that referenced this issue Dec 5, 2023
* Add failing unit test for scenario 1 in #11878.

* Set TabOnceActiveElement on realized container.

Fixes scenario 1 in #11878.

* Use TabOnceActiveElement to decide focused element.

Fixes scenario #3 in #11878.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant