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
12 changes: 12 additions & 0 deletions packages/calcite-components/src/components/dialog/dialog.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,18 @@ describe("calcite-dialog", () => {
});
});

it("content with visibility: visible should not be focusable when closed", async () => {
const page = await newE2EPage();
await page.setContent(html`
<calcite-dialog>
<button id="should-not-be-keyboard-focusable" style="visibility: visible">hi</button>
</calcite-dialog>
`);

await page.keyboard.press("Tab");
expect(await isElementFocused(page, "#should-not-be-keyboard-focusable")).toBe(false);
});

it("has correct aria role/attribute", async () => {
const page = await newE2EPage();
await page.setContent(`<calcite-dialog open>Hello world!</calcite-dialog>`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,7 @@ export class Dialog extends LitElement implements OpenCloseComponent {
description={description}
heading={heading}
headingLevel={this.headingLevel}
hidden={!this.opened}
icon={icon}
iconFlipRtl={iconFlipRtl}
loading={this.loading}
Expand Down
Loading