Skip to content
Merged
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
14 changes: 13 additions & 1 deletion packages/main/cypress/specs/ResponsivePopover.mobile.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Input from "../../src/Input.js";
import Label from "../../src/Label.js";

describe("ResponsivePopover mobile general interaction", () => {
before(() => {
beforeEach(() => {
cy.ui5SimulateDevice();
});

Expand All @@ -21,6 +21,18 @@ describe("ResponsivePopover mobile general interaction", () => {
.find("[ui5-dialog]")
.should("be.visible");
});

it("tests showing of the dialog on phone", () => {
cy.mount(<ResponsivePopover open={true} />);

cy.get("[ui5-responsive-popover]")
.shadow()
.find("[ui5-dialog]")
.should("be.visible");

cy.get("[ui5-responsive-popover]")
.should("not.be.visible");
});
});

describe("Accessibility", () => {
Expand Down
10 changes: 7 additions & 3 deletions packages/main/src/Popup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,13 +290,17 @@ abstract class Popup extends UI5Element {

this.tabIndex = -1;

this.handleOpenOnEnterDOM();

this.setAttribute("data-sap-ui-fastnavgroup-container", "true");
registerUI5Element(this, this._updateAssociatedLabelsTexts.bind(this));
}

handleOpenOnEnterDOM() {
if (this.open) {
this.showPopover();
this.openPopup();
}

this.setAttribute("data-sap-ui-fastnavgroup-container", "true");
registerUI5Element(this, this._updateAssociatedLabelsTexts.bind(this));
}

onExitDOM() {
Expand Down
7 changes: 7 additions & 0 deletions packages/main/src/ResponsivePopover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ class ResponsivePopover extends Popover {
}
}

handleOpenOnEnterDOM() {
if (this.open && !isPhone()) {
this.showPopover();
this.openPopup();
}
}

_dialogCloseButtonClick() {
this.closePopup();
}
Expand Down
Loading