Skip to content

Commit

Permalink
fix(ui5-input): deselect suggestion items on input (#2285)
Browse files Browse the repository at this point in the history
Fixes #2256
  • Loading branch information
fifoosid authored and ilhan007 committed Nov 5, 2020
1 parent 6f325c5 commit 8fe6d84
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/main/src/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,10 @@ class Input extends UI5Element {
return this._handleEscape(event);
}

if (this.showSuggestions) {
this.Suggestions._deselectItems();
}

this._keyDown = true;
}

Expand Down
7 changes: 7 additions & 0 deletions packages/main/src/features/InputSuggestions.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,13 @@ class Suggestions {
}
}

_deselectItems() {
const items = this._getItems();
items.forEach(item => {
item.selected = false;
});
}

_isItemIntoView(item) {
const rectItem = item.getDomRef().getBoundingClientRect();
const rectInput = this._getComponent().getDomRef().getBoundingClientRect();
Expand Down

0 comments on commit 8fe6d84

Please sign in to comment.