Skip to content

Commit

Permalink
fix(ui5-multi-combobox): hide value state message popup when popover …
Browse files Browse the repository at this point in the history
…is open (#9511)

* fix(ui5-multi-combobox): hide value state message popup when popover is opened

Fixes #9451
  • Loading branch information
nikoletavnv authored Jul 30, 2024
1 parent 7b4cf30 commit f887689
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/main/src/MultiComboBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1906,7 +1906,7 @@ class MultiComboBox extends UI5Element implements IFormInputElement {
}

get shouldDisplayOnlyValueStateMessage() {
return this.focused && !this.readonly && this.hasValueStateMessage && !this._iconPressed;
return this.focused && !this.readonly && this.hasValueStateMessage && !this._iconPressed && !this.open;
}

get valueStateTypeMappings(): ValueStateTypeAnnouncement {
Expand Down
29 changes: 29 additions & 0 deletions packages/main/test/specs/MultiComboBox.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1521,6 +1521,35 @@ describe("MultiComboBox general interaction", () => {
assert.notOk(await popover.getProperty("open"), "Popover with valueStateMessage should not be opened.");
});

it("Should not open value state popup when popover is open after clicking n more link", async () => {
const mcb = await browser.$("#mcb-select-all-vs");

await mcb.scrollIntoView();
await mcb.click();

const popover = await mcb.shadow$("ui5-responsive-popover");
const valueStatePopover = await mcb.shadow$("ui5-popover");

assert.notOk(await popover.getProperty("open"), "Popover with value state message header should not be opened.");
assert.ok(await valueStatePopover.getProperty("open"), "Value state popover should be opened.");

await mcb.keys("F4");
await browser.keys("ArrowUp");
await browser.keys("Enter");
await browser.keys("Tab");

const nMoreText = await mcb.shadow$("ui5-tokenizer").shadow$(".ui5-tokenizer-more-text");
nMoreText.click();

await browser.waitUntil(async () => mcb.getProperty("open"), {
timeout: 1000,
timeoutMsg: "Popover is open"
});

assert.ok(await popover.getProperty("open"), "Popover with value state message header should be opened.");
assert.notOk(await valueStatePopover.getProperty("open"), "Value state popover should not be opened.");
});

it("Should apply correct text to the tokens overflow indicator", async () => {
const mcNItems = await browser.$("#mc-items");
const mcNMore = await browser.$("#mc-more");
Expand Down

0 comments on commit f887689

Please sign in to comment.