Skip to content

ComboBox: Make comboBox menus wrap#4482

Merged
jspurlin merged 6 commits intomicrosoft:masterfrom
jspurlin:jspurlin/MakeComboBoxesWrap
Apr 7, 2018
Merged

ComboBox: Make comboBox menus wrap#4482
jspurlin merged 6 commits intomicrosoft:masterfrom
jspurlin:jspurlin/MakeComboBoxesWrap

Conversation

@jspurlin
Copy link
Copy Markdown
Contributor

@jspurlin jspurlin commented Apr 6, 2018

Pull request checklist

  • Addresses an existing issue: Fixes #0000
  • Include a change request file using $ npm run change

Description of changes

This PR updates comboBoxes so that arrowing through the items will wrap at the top and bottom. As a result comboBoxes will behave like dropdowns (and we also got customer feedback that they expected focus to loop around the items)

Focus areas to test

Verified that focus wraps from top to bottom and bottom to top in a flat list, a list that starts/ends with a non-focusable element (like a header or divider), and that this works with dynamically loaded items

// item is not focusable), otherwise use the updated index
if (index === indexUpdate) {
if (searchDirection === SearchDirection.forward) {
index = this._getNextSelectableIndex(-1, searchDirection);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not super familiar with this codepath, does the unit test cover the code in the if(index == indexUpdate ) branch?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. I've added another test to exercise this codepath

@jspurlin jspurlin merged commit 5eeebc1 into microsoft:master Apr 7, 2018
@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants