Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions packages/main/cypress/specs/MultiComboBox.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4371,6 +4371,29 @@ describe("Keyboard Handling", () => {
.should("have.length", 3);
});

it("Should open overflow popover on Enter when MCB is readonly", () => {
cy.mount(
<MultiComboBox noValidation={true} readonly={true}>
<MultiComboBoxItem selected={true} text="Item 1"></MultiComboBoxItem>
<MultiComboBoxItem selected={true} text="Item 2"></MultiComboBoxItem>
</MultiComboBox>
);

cy.get("[ui5-multi-combobox]")
.shadow()
.find("input")
.realClick();

cy.realPress("Enter");

cy.get("[ui5-multi-combobox]")
.shadow()
.find("[ui5-tokenizer]")
.shadow()
.find<ResponsivePopover>("[ui5-responsive-popover]")
.ui5ResponsivePopoverOpened();
});

it("Should open/close popover on keyboard combination ctrl + i", () => {
cy.mount(
<MultiComboBox noValidation={true}>
Expand Down
5 changes: 5 additions & 0 deletions packages/main/src/MultiComboBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1435,6 +1435,11 @@ class MultiComboBox extends UI5Element implements IFormInputElement {
}

_handleEnter() {
if (this.readonly) {
this._tokenizer.open = true;
return;
}

const lowerCaseValue = this.value.toLowerCase();
const matchingItem = this._getItems().find(item => (!item.isGroupItem && item.text!.toLowerCase() === lowerCaseValue));
const oldValueState = this.valueState;
Expand Down
Loading