Skip to content

Commit 7f0cadc

Browse files
committed
fix(studio): drop aria-modal from the non-modal shortcuts popup
The panel does not trap focus and leaves the rest of the editor operable, so aria-modal would tell assistive tech the whole app is inert while it is open. role=dialog plus aria-controls and Escape is the correct non-modal disclosure shape.
1 parent aa28116 commit 7f0cadc

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎packages/studio/src/player/components/ShortcutsPanel.test.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ describe("ShortcutsPanel", () => {
150150

151151
expect(panelId).not.toBeNull();
152152
expect(panel?.getAttribute("role")).toBe("dialog");
153-
expect(panel?.getAttribute("aria-modal")).toBe("true");
153+
// Non-modal on purpose: focus is not trapped and the editor behind stays
154+
// operable, so aria-modal would lie to assistive tech about inertness.
155+
expect(panel?.getAttribute("aria-modal")).toBeNull();
154156
expect(panel?.id).toBe(panelId);
155157
});
156158
});

‎packages/studio/src/player/components/ShortcutsPanel.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,9 @@ export const ShortcutsPanel = memo(function ShortcutsPanel({
170170
<div
171171
id={shortcutsPanelId}
172172
role="dialog"
173-
aria-modal="true"
173+
// Deliberately NOT aria-modal. This is a non-modal disclosure: focus is
174+
// not trapped and the rest of the editor stays operable, so claiming
175+
// modality would make assistive tech treat the whole app as inert.
174176
className="absolute bottom-full right-0 mb-2 z-50 rounded-lg shadow-xl min-w-[220px] overflow-y-auto"
175177
style={{
176178
background: "#161618",

0 commit comments

Comments
 (0)