Skip to content

Commit

Permalink
fix(ui5-tabcontainer): fix closing overflow on mobile (#5855)
Browse files Browse the repository at this point in the history
Fixes #5854
  • Loading branch information
gmkv committed Sep 29, 2022
1 parent 2ec2233 commit 996714e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/main/src/TabContainer.js
Expand Up @@ -1145,6 +1145,11 @@ class TabContainer extends UI5Element {
return staticAreaItem.querySelector(`#${this._id}-overflowMenu`);
}

async _closeRespPopover() {
this.responsivePopover = await this._respPopover();
this.responsivePopover.close();
}

get classes() {
return {
root: {
Expand Down
23 changes: 23 additions & 0 deletions packages/main/test/specs/TabContainer.mobile.spec.js
@@ -0,0 +1,23 @@
const assert = require("chai").assert;

describe("Mobile: TabContainer general interaction", () => {
before(async () => {
await browser.url("test/pages/TabContainer.html");
await browser.emulateDevice("iPhone X");
});

it("should close the overflow popover when pressing the cancel button", async () => {
const moreButton = await browser.$("#tabContainerNestedTabs").shadow$(`[data-ui5-stable="overflow-end"]`);
await moreButton.click();

const staticAreaItemClassName = await browser.getStaticAreaItemClassName("#tabContainerNestedTabs");
let overflow = await browser.$(`.${staticAreaItemClassName}`).shadow$("ui5-responsive-popover");
const closeButton = await overflow.$("ui5-button");

assert.ok(await overflow.getProperty("open"), "Overflow is opened");

await closeButton.click();

assert.notOk(await overflow.getProperty("open"), "Overflow is closed");
});
});

0 comments on commit 996714e

Please sign in to comment.