Skip to content

Commit

Permalink
fix(ui5-multi-combobox): collapse the tokenizer on mobile devices (#9406
Browse files Browse the repository at this point in the history
)

* fix(ui5-multi-combobox): collapse the tokenizer on mobile devices picker close

fixes: #9176
  • Loading branch information
ndeshev authored Jul 10, 2024
1 parent 5537438 commit 6187df8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/main/src/MultiComboBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1440,6 +1440,7 @@ class MultiComboBox extends UI5Element {
// close device's keyboard and prevent further typing
if (isPhone()) {
this._dialogInputValueState = this.valueState;
this._tokenizer.expanded = false;
this.blur();
}

Expand Down
19 changes: 19 additions & 0 deletions packages/main/test/specs/MultiComboBox.mobile.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,25 @@ describe("Basic interaction", () => {
assert.notOk(await picker.isDisplayedInViewport(), "Picker is closed now");
});

it("Should collapse the tokenizer when the picker is closed", async () => {
const mcb = await browser.$("#multi1");
const tokenizer = await mcb.shadow$('ui5-tokenizer');
const staticAreaItemClassName = await browser.getStaticAreaItemClassName("#multi1");
const picker = await browser.$(`.${staticAreaItemClassName}`).shadow$("ui5-responsive-popover");
const dialogCloseButton = await picker.$(".ui5-responsive-popover-close-btn");

await mcb.click();
await dialogCloseButton.click();

assert.notOk(await tokenizer.getAttribute("expanded"), "The tokenizer is not expanded after closing the picker");

await tokenizer.shadow$(".ui5-tokenizer-more-text").click();

assert.notOk(await tokenizer.getAttribute("expanded"), "The tokenizer is not expanded after closing the picker when opened from the 'n-more' link");

await dialogCloseButton.click();
});

it("Should close the mobile picker dialog when pressing the OK button", async () => {
const multiCombo = await browser.$("#multi1");
const staticAreaItemClassName = await browser.getStaticAreaItemClassName("#multi1");
Expand Down

0 comments on commit 6187df8

Please sign in to comment.