Skip to content

Commit

Permalink
Fixed searchbar not focusing when navigating using up and down arrows
Browse files Browse the repository at this point in the history
  • Loading branch information
ZenMasterJacob20011 committed Jun 19, 2024
1 parent 0b97298 commit e25521b
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/utils/ChoicesWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,24 @@ class ChoicesWrapper extends Choices {
}
}

_selectHighlightedChoice(activeItems) {
_selectHighlightedChoice() {
const highlightedChoice = this.dropdown.getChild(
`.${this.config.classNames.highlightedState}`,
);

if (highlightedChoice) {
this._handleChoiceAction(activeItems, highlightedChoice);
const id = highlightedChoice.dataset.id;
const choice = id && this._store.getChoiceById(id);
this._addItem({
value: choice.value,
label: choice.label,
choiceId: choice.id,
groupId: choice.groupId,
customProperties: choice.customProperties,
placeholder: choice.placeholder,
keyCode: choice.keyCode
});
this._triggerChange(choice.value);
}

event.preventDefault();
Expand Down

0 comments on commit e25521b

Please sign in to comment.