From e25521bd50a43704507045178a45d347cffdce02 Mon Sep 17 00:00:00 2001 From: ZenMasterJacob20011 Date: Wed, 19 Jun 2024 12:39:14 -0500 Subject: [PATCH] Fixed searchbar not focusing when navigating using up and down arrows --- src/utils/ChoicesWrapper.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/utils/ChoicesWrapper.js b/src/utils/ChoicesWrapper.js index e802db579c..9ae4d9829c 100644 --- a/src/utils/ChoicesWrapper.js +++ b/src/utils/ChoicesWrapper.js @@ -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();