fix(canvas/a11y): add accessible name to ConsoleModal + DeleteCascadeConfirmDialog backdrops
ConsoleModal backdrop: aria-hidden removed, aria-label="Close terminal" added. DeleteCascadeConfirmDialog backdrop: aria-hidden removed, aria-label="Dismiss dialog" added. cursor-pointer also added to both for consistent pointer affordance. Matches the same fix applied to KeyboardShortcutsDialog (PR #299) and ConfirmDialog (PR #398) for WCAG 2.4.6 compliance. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
108b9a54d9
commit
c740d4aa27
@ -90,7 +90,11 @@ export function ConsoleModal({ workspaceId, workspaceName, open, onClose }: Prop
|
||||
|
||||
return createPortal(
|
||||
<div className="fixed inset-0 z-[9999] flex items-center justify-center">
|
||||
<div aria-hidden="true" className="absolute inset-0 bg-black/70 backdrop-blur-sm" onClick={onClose} />
|
||||
<div
|
||||
className="absolute inset-0 bg-black/70 backdrop-blur-sm cursor-pointer"
|
||||
onClick={onClose}
|
||||
aria-label="Close terminal"
|
||||
/>
|
||||
<div
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
|
||||
@ -81,7 +81,11 @@ export function DeleteCascadeConfirmDialog({
|
||||
return createPortal(
|
||||
<div className="fixed inset-0 z-[9999] flex items-center justify-center">
|
||||
{/* Backdrop */}
|
||||
<div aria-hidden="true" className="absolute inset-0 bg-black/60 backdrop-blur-sm" onClick={onCancel} />
|
||||
<div
|
||||
className="absolute inset-0 bg-black/60 backdrop-blur-sm cursor-pointer"
|
||||
onClick={onCancel}
|
||||
aria-label="Dismiss dialog"
|
||||
/>
|
||||
|
||||
{/* Dialog */}
|
||||
<div
|
||||
|
||||
@ -98,10 +98,10 @@ describe("ConsoleModal — WCAG 2.1 dialog accessibility", () => {
|
||||
expect(titleEl?.textContent?.trim()).toBe("EC2 console output");
|
||||
});
|
||||
|
||||
it("backdrop div has aria-hidden='true' so screen readers skip it (WCAG 4.1.2)", async () => {
|
||||
it("backdrop div has aria-label for screen readers (WCAG 2.4.6)", async () => {
|
||||
mockGet.mockResolvedValueOnce({ output: "" });
|
||||
render(<ConsoleModal workspaceId="ws-1" open={true} onClose={() => {}} />);
|
||||
const backdrop = document.querySelector('[aria-hidden="true"]');
|
||||
const backdrop = document.querySelector('[aria-label="Close terminal"]');
|
||||
expect(backdrop).toBeTruthy();
|
||||
expect(backdrop?.className).toContain("bg-black");
|
||||
});
|
||||
|
||||
@ -99,9 +99,9 @@ describe("DeleteCascadeConfirmDialog — WCAG 2.1 dialog accessibility", () => {
|
||||
expect(titleEl?.textContent?.trim()).toBe("Delete Workspace and Children");
|
||||
});
|
||||
|
||||
it("backdrop div has aria-hidden='true' so screen readers skip it (WCAG 4.1.2)", () => {
|
||||
it("backdrop div has aria-label for screen readers (WCAG 2.4.6)", () => {
|
||||
renderDialog();
|
||||
const backdrop = document.querySelector('[aria-hidden="true"]');
|
||||
const backdrop = document.querySelector('[aria-label="Dismiss dialog"]');
|
||||
expect(backdrop).toBeTruthy();
|
||||
expect(backdrop?.className).toContain("bg-black");
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user