Skip to content

Commit

Permalink
fix(ui5-select): select correct item by typing text (#5252)
Browse files Browse the repository at this point in the history
  • Loading branch information
nnaydenow authored May 23, 2022
1 parent e152c45 commit 24401b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/main/src/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ class Select extends UI5Element {
const itemToSelect = this._searchNextItemByText(text);

if (itemToSelect) {
const nextIndex = this._getSelectedItemIndex(itemToSelect);
const nextIndex = this._filteredItems.indexOf(itemToSelect);

this._changeSelectedItem(this._selectedIndex, nextIndex);

Expand Down Expand Up @@ -547,7 +547,7 @@ class Select extends UI5Element {
}

_getSelectedItemIndex(item) {
return [].indexOf.call(item.parentElement.children, item);
return this._filteredItems.findIndex(option => `${option._id}-li` === item.id);
}

_select(index) {
Expand Down

0 comments on commit 24401b2

Please sign in to comment.