Skip to content

Commit 85f01d7

Browse files
authored
fix(ui5-input): fix exceptions thrown when KH used (#1301)
1 parent fa6b38f commit 85f01d7

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

packages/main/src/Input.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -436,13 +436,13 @@ class Input extends UI5Element {
436436

437437
/* Event handling */
438438
_handleUp(event) {
439-
if (this.Suggestions) {
439+
if (this.Suggestions && this.Suggestions.isOpened()) {
440440
this.Suggestions.onUp(event);
441441
}
442442
}
443443

444444
_handleDown(event) {
445-
if (this.Suggestions) {
445+
if (this.Suggestions && this.Suggestions.isOpened()) {
446446
this.Suggestions.onDown(event);
447447
}
448448
}

packages/main/src/InputPopover.hbs

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<ui5-list separators="Inner">
3737
{{#each suggestionsTexts}}
3838
<ui5-li
39-
?icon="{{this.icon}}"
39+
icon="{{this.icon}}"
4040
@ui5-_itemPress="{{ fnOnSuggestionItemPress }}"
4141
>{{ this.text }}</ui5-li>
4242
{{/each}}

packages/main/src/features/InputSuggestions.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ class Suggestions {
247247

248248
_getScrollContainer() {
249249
if (!this._scrollContainer) {
250-
this._scrollContainer = this._respPopover.getDomRef().shadowRoot.querySelector(".ui5-popover-content");
250+
this._scrollContainer = this._respPopover.getDomRef().querySelector(".ui5-popover-content");
251251
}
252252

253253
return this._scrollContainer;

packages/main/test/specs/Input.spec.js

+1
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ describe("Input general interaction", () => {
175175
assert.strictEqual(suggestionsInput.getValue(), "Cozy", "First item has been selected");
176176
assert.strictEqual(inputResult.getValue(), "1", "suggestionItemSelected event called once");
177177

178+
suggestionsInput.keys("c"); // to open the suggestions pop up once again
178179
suggestionsInput.keys("ArrowUp");
179180

180181
assert.strictEqual(suggestionsInput.getValue(), "Condensed", "First item has been selected");

0 commit comments

Comments
 (0)