Simple Combo tries to set an item's header as selection target #14352
Labels
🐛 bug
Any issue that describes a bug
simple-combo
✅ status: resolved
Applies to issues that have pending PRs resolving them, or PRs that have already merged.
Description
Steps to reproduce
ariz
as a filter term, or just enter any value that will result in at least one match.ArrowDown
ArrowUp
Enter
Result
Mount
is entered in the combo's input as a selection. Which is the element's group's header name.Expected result
Either return focus to the input to allow the user to change the filter (and close the dropdown) or select
Arizona
/ the first match that is found.Attachment
Additional info
This happens because after step 5 the combo's dropdown will have
focusedItem
to be the first element in the dropdown which happens to be a header element. Then onEnter
that element is used when trying to set the combo's value. As this element is not part of the data set it will be immediately rejected / the combo clears on blur even if the input is populated with the element / the element's id.From a user's perspective the combo is in an edit state and expects the filter to be either edited or applied. If the former scenario is assumed, the combo should just close the dropdown and allow the user to continue editing since the input will be in focus. If the latter scenario is assumed,
Enter
should result inArizona
being set as the combo's value.The text was updated successfully, but these errors were encountered: