Skip to content
Open
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
15b2f74
feat(ui5-dialog): add fullscreen toggle button
kskondov Jun 12, 2026
3aab8a0
feat(ui5-dialog): add fullscreen toggle button
kskondov Jun 12, 2026
8a9133b
feat(ui5-dialog): add fullscreen toggle button
kskondov Jun 12, 2026
a84d0ed
Merge branch 'main' into ui5-dialog-fullscreen
kskondov Jun 15, 2026
c7a9443
feat(ui5-dialog): add fullscreen toggle button
kskondov Jun 15, 2026
b75d57d
Merge branch 'ui5-dialog-fullscreen' of github.com:SAP/ui5-webcompone…
kskondov Jun 15, 2026
d77f4e5
feat(ui5-dialog): add fullscreen toggle button
kskondov Jun 15, 2026
9660dff
feat(ui5-dialog): add fullscreen toggle button
kskondov Jun 15, 2026
4aba3ac
Merge branch 'main' of github.com:SAP/ui5-webcomponents into ui5-dial…
kskondov Jun 17, 2026
1b2bb06
feat(ui5-dialog): add fullscreen toggle button
kskondov Jun 17, 2026
0f065c7
Merge remote-tracking branch 'origin/main' into ui5-dialog-fullscreen
TeodorTaushanov Jun 22, 2026
72e96d6
chore: resolve merge conflics
TeodorTaushanov Jun 22, 2026
324a5fd
chore: fix double click and acc texts
TeodorTaushanov Jun 22, 2026
f4ddf36
Merge remote-tracking branch 'origin/main' into ui5-dialog-fullscreen
TeodorTaushanov Jun 22, 2026
5e2a395
chore: fix first focusable element
TeodorTaushanov Jun 22, 2026
94b83d8
chore: fix tests
TeodorTaushanov Jun 22, 2026
8fde8c0
Merge remote-tracking branch 'origin/main' into ui5-dialog-fullscreen
TeodorTaushanov Jun 22, 2026
0dfdb02
chore: fix lint error
TeodorTaushanov Jun 22, 2026
3bf1226
chore: fix test
TeodorTaushanov Jun 23, 2026
f5b2f0b
Merge remote-tracking branch 'origin/main' into ui5-dialog-fullscreen
TeodorTaushanov Jun 24, 2026
c63cd20
chore: fix toggling multiple dialogs
TeodorTaushanov Jun 24, 2026
a5738fc
chore: address code comments
TeodorTaushanov Jun 24, 2026
0ced4f0
chore: address code comments and add tests
TeodorTaushanov Jun 24, 2026
17b5076
Merge remote-tracking branch 'origin/main' into ui5-dialog-fullscreen
TeodorTaushanov Jun 24, 2026
5dc6eaf
chore: add release version
TeodorTaushanov Jun 25, 2026
c8bf2ba
Merge remote-tracking branch 'origin/main' into ui5-dialog-fullscreen
TeodorTaushanov Jun 25, 2026
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
281 changes: 280 additions & 1 deletion packages/main/cypress/specs/Dialog.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ describe("Dialog general interaction", () => {
.shadow()
.find(".ui5-popup-resize-handle")
.realMouseDown()
.realMouseMove(150, 0) // Additional rightward movement beyond min width
.realMouseMove(350, 0) // Additional rightward movement beyond min width
.realMouseUp();

cy.get("#rtl-min-width-dialog").then(dialogAfterExtraResize => {
Expand Down Expand Up @@ -1846,3 +1846,282 @@ describe("Native drag-and-drop in draggable dialogs", () => {
});
});
});

describe("Fullscreen Button", () => {
it("should show fullscreen button when showFullscreenButton is set", () => {
cy.mount(
<Dialog id="dialog" headerText="Test" showFullscreenButton={true} open={true}>
<Button>Content</Button>
</Dialog>
);

cy.get<Dialog>("#dialog").ui5DialogOpened();

cy.get("#dialog")
.shadow()
.find(".ui5-dialog-fullscreen-btn")
.should("exist")
.and("be.visible");
});

it("should not show fullscreen button when showFullscreenButton is not set", () => {
cy.mount(
<Dialog id="dialog" headerText="Test" open={true}>
<Button>Content</Button>
</Dialog>
);

cy.get<Dialog>("#dialog").ui5DialogOpened();

cy.get("#dialog")
.shadow()
.find(".ui5-dialog-fullscreen-btn")
.should("not.exist");
});

it("should toggle stretch property when fullscreen button is clicked", () => {
cy.mount(
<Dialog id="dialog" headerText="Test" showFullscreenButton={true} open={true}>
<Button>Content</Button>
</Dialog>
);

cy.get<Dialog>("#dialog").ui5DialogOpened();

cy.get("#dialog")
.should("not.have.attr", "stretch");

cy.get("#dialog").then($dialog => {
($dialog.get(0) as Dialog)._toggleFullscreen();
});
Comment thread
TeodorTaushanov marked this conversation as resolved.
Outdated

cy.get("#dialog")
.should("have.attr", "stretch");

cy.get("#dialog").then($dialog => {
($dialog.get(0) as Dialog)._toggleFullscreen();
});

cy.get("#dialog")
.should("not.have.attr", "stretch");
});

it("should show full-screen icon when not stretched and exit-full-screen when stretched", () => {
cy.mount(
<Dialog id="dialog" headerText="Test" showFullscreenButton={true} open={true}>
<Button>Content</Button>
</Dialog>
);

cy.get<Dialog>("#dialog").ui5DialogOpened();

cy.get("#dialog")
.shadow()
.find(".ui5-dialog-fullscreen-btn")
.should("have.attr", "icon", "full-screen");

cy.get("#dialog").then($dialog => {
($dialog.get(0) as Dialog)._toggleFullscreen();
});

cy.get("#dialog")
.shadow()
.find(".ui5-dialog-fullscreen-btn")
.should("have.attr", "icon", "exit-full-screen");
});

it("should have correct tooltip based on stretch state", () => {
cy.mount(
<Dialog id="dialog" headerText="Test" showFullscreenButton={true} open={true}>
<Button>Content</Button>
</Dialog>
);

cy.get<Dialog>("#dialog").ui5DialogOpened();

cy.get("#dialog")
.shadow()
.find(".ui5-dialog-fullscreen-btn")
.should("have.attr", "tooltip", "Maximize (Shift+Ctrl+F)");

cy.get("#dialog").then($dialog => {
($dialog.get(0) as Dialog)._toggleFullscreen();
});

cy.get("#dialog")
.shadow()
.find(".ui5-dialog-fullscreen-btn")
.should("have.attr", "tooltip", "Restore (Shift+Ctrl+F)");
});

it("should have aria-keyshortcuts attribute", () => {
cy.mount(
<Dialog id="dialog" headerText="Test" showFullscreenButton={true} open={true}>
<Button>Content</Button>
</Dialog>
);

cy.get<Dialog>("#dialog").ui5DialogOpened();

cy.get("#dialog")
.shadow()
.find(".ui5-dialog-fullscreen-btn")
.shadow()
.find("button")
.should("have.attr", "aria-keyshortcuts", "Shift+Ctrl+F");
});

it("should toggle fullscreen with Shift+Ctrl+F keyboard shortcut", () => {
cy.mount(
<Dialog id="dialog" headerText="Test" showFullscreenButton={true} open={true}>
<Input id="input"></Input>
</Dialog>
);

cy.get<Dialog>("#dialog").ui5DialogOpened();

cy.get("#dialog")
.should("not.have.attr", "stretch");

cy.get("#input").realClick();
cy.realPress(["Shift", "Control", "f"]);

cy.get("#dialog")
.should("have.attr", "stretch");

cy.realPress(["Shift", "Control", "f"]);

cy.get("#dialog")
.should("not.have.attr", "stretch");
});

it("should toggle fullscreen on header double-click", () => {
cy.mount(
<Dialog id="dialog" headerText="Test Dialog" showFullscreenButton={true} open={true}>
<Button>Content</Button>
</Dialog>
);

cy.get<Dialog>("#dialog").ui5DialogOpened();

cy.get("#dialog")
.should("not.have.attr", "stretch");

cy.get("#dialog").then($dialog => {
const dialog = $dialog.get(0) as Dialog;
const headerRoot = dialog.shadowRoot!.querySelector(".ui5-popup-header-root")!;
const event = new MouseEvent("dblclick", { bubbles: true, composed: true });
Object.defineProperty(event, "target", { value: headerRoot });
headerRoot.dispatchEvent(event);
});

cy.get("#dialog")
.should("have.attr", "stretch");
});

it("should not toggle fullscreen on double-click when showFullscreenButton is false", () => {
cy.mount(
<Dialog id="dialog" headerText="Test Dialog" open={true}>
<Button>Content</Button>
</Dialog>
);

cy.get<Dialog>("#dialog").ui5DialogOpened();

cy.get("#dialog")
.shadow()
.find(".ui5-popup-header-root")
.realClick({ clickCount: 2 });

cy.get("#dialog")
.should("not.have.attr", "stretch");
});

it("should reset drag/resize state when toggling fullscreen", () => {
cy.mount(
<Dialog id="dialog" headerText="Test" showFullscreenButton={true} draggable={true} open={true}>
<Button>Content</Button>
</Dialog>
);

cy.get<Dialog>("#dialog").ui5DialogOpened();

cy.get("#dialog").then($dialog => {
const dialog = $dialog.get(0) as Dialog;
dialog._draggedOrResized = true;
Object.assign(dialog.style, { top: "100px", left: "100px", width: "400px", height: "300px" });
});

cy.get("#dialog")
.shadow()
.find(".ui5-dialog-fullscreen-btn")
.realClick();

cy.get("#dialog").then($dialog => {
const dialog = $dialog.get(0) as Dialog;
expect(dialog._draggedOrResized).to.be.false;
expect(dialog.style.width).to.equal("");
expect(dialog.style.height).to.equal("");
});
});

it("should display header when only showFullscreenButton is set", () => {
cy.mount(
<Dialog id="dialog" showFullscreenButton={true} open={true}>
<Button>Content</Button>
</Dialog>
);

cy.get<Dialog>("#dialog").ui5DialogOpened();

cy.get("#dialog")
.shadow()
.find(".ui5-popup-header-root")
.should("exist");
});

it("should reflect stretch state if stretch is initially true", () => {
cy.mount(
<Dialog id="dialog" headerText="Test" showFullscreenButton={true} stretch={true} open={true}>
<Button>Content</Button>
</Dialog>
);

cy.get<Dialog>("#dialog").ui5DialogOpened();

cy.get("#dialog")
.shadow()
.find(".ui5-dialog-fullscreen-btn")
.should("have.attr", "icon", "exit-full-screen")
.and("have.attr", "tooltip", "Restore (Shift+Ctrl+F)");

cy.get("#dialog").invoke("prop", "open", false);
});

it("should not focus fullscreen button as initial focus when content has focusable elements", () => {
cy.mount(
<Dialog id="dialog" headerText="Test" showFullscreenButton={true} open={true}>
<Button id="content-btn">Content Button</Button>
</Dialog>
);

cy.get<Dialog>("#dialog").ui5DialogOpened();

cy.get("#content-btn").should("be.focused");
});

it("should focus fullscreen button when no other focusable elements exist", () => {
cy.mount(
<Dialog id="dialog" headerText="Test" showFullscreenButton={true} open={true}>
<p>Non-focusable content</p>
</Dialog>
);

cy.get<Dialog>("#dialog").ui5DialogOpened();

cy.get("#dialog")
.shadow()
.find(".ui5-dialog-fullscreen-btn")
.should("be.focused");
});
});
Loading
Loading