Skip to content

Commit a98c6bd

Browse files
authoredOct 8, 2020
fix(ui5-input): deselect suggestion items on input (#2285)
Fixes #2256
1 parent d430632 commit a98c6bd

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed
 

‎packages/main/src/Input.js

+4
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,10 @@ class Input extends UI5Element {
605605
return this._handleEscape(event);
606606
}
607607

608+
if (this.showSuggestions) {
609+
this.Suggestions._deselectItems();
610+
}
611+
608612
this._keyDown = true;
609613
}
610614

‎packages/main/src/features/InputSuggestions.js

+7
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,13 @@ class Suggestions {
301301
}
302302
}
303303

304+
_deselectItems() {
305+
const items = this._getItems();
306+
items.forEach(item => {
307+
item.selected = false;
308+
});
309+
}
310+
304311
_isItemIntoView(item) {
305312
const rectItem = item.getDomRef().getBoundingClientRect();
306313
const rectInput = this._getComponent().getDomRef().getBoundingClientRect();

0 commit comments

Comments
 (0)
Please sign in to comment.