use default option in combobox #110
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In #51 we added
data-autoselect
which allows pressingEnter
to commit the first result, if no others have been selected.The problem is that with this option, it overrides the behaviour of the combobox events, which causes the first option to always be selected. https://github.com/github/accessibility-audits/issues/4434 has been raised around this issue.
Steps to reproduce:
bender
bender
optionEnter
Expected result:
The input is now populated with
@bender
.Actual result:
The input is populated with
@hubot
.Solution
The solution is to use
combox-nav
'sdefaultFirstOption
flag, and callingindicateFirstOption
when the list is presented. This waycombobox-nav
is in charge of this behaviour, and not this element.