Skip to content

Commit 6cc458b

Browse files
authored
fix(ui5-input): prevent selection of suggestion group item (#2777)
FIXES: #2255
1 parent 83d09dd commit 6cc458b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

packages/main/src/features/InputSuggestions.js

+4
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ class Suggestions {
167167
return;
168168
}
169169

170+
if (item.group) {
171+
return;
172+
}
173+
170174
this._getComponent().onItemSelected(this._getRealItems()[this.selectedItemIndex], keyboardUsed);
171175
item.selected = false;
172176
this.close();

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

+4
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,15 @@ describe("Input general interaction", () => {
239239
it("handles group suggestion item via keyboard", () => {
240240
const suggestionsInput = $("#myInputGrouping").shadow$("input");
241241
const inputResult = $("#inputResultGrouping").shadow$("input");
242+
const staticAreaItemClassName = browser.getStaticAreaItemClassName("#myInputGrouping");
243+
const respPopover = browser.$(`.${staticAreaItemClassName}`).shadow$("ui5-responsive-popover");
242244

243245
suggestionsInput.click();
244246
suggestionsInput.keys("ArrowDown");
245247
suggestionsInput.keys("Enter");
248+
browser.pause(300);
246249

250+
assert.ok(respPopover.getProperty("opened"), "Popover should not be closed after trying to select a group header.");
247251
assert.strictEqual(suggestionsInput.getValue(), "", "Group item is not selected");
248252
assert.strictEqual(inputResult.getValue(), "", "suggestionItemSelected event is not called");
249253
});

0 commit comments

Comments
 (0)