Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): screen readers can reach sidebar row actions #13962

Closedakj(GitHub profile, opens in a new tab)wants to merge 16 commits intomain fromrefs/pull/13962/headopened View on GitHub

Showing 4 changed files with 69 additions and 43 deletions (loading 2).

x
0 of 4 viewed, 4 left
22 additions and 20 deletionsapps/web/src/components/sidebar/SidebarDraftBlock.tsxModified
View file
@@ -19,7 +19,13 @@
type ComposerThreadDraftState,
type DraftSessionState,
} from "../../composerDraftStore";
-import { draftPenClassName, draftSurfaceClassName } from "./SidebarThreadRow";
+import {
+ draftPenClassName,
+ draftSurfaceClassName,
+ SidebarRowPrimaryAction,
+ focusSidebarRowPrimaryAction,
+ SIDEBAR_ROW_SECONDARY_CONTROL_SELECTOR,
+} from "./SidebarThreadRow";
​
const SidebarDraftRow = memo(function SidebarDraftRow(props: {
draftId: DraftId;
@@ -56,22 +62,21 @@
});
const handleActivate = () => onNavigate(draftId);
const handleKeyDown = (event: ReactKeyboardEvent) => {
- // Keys targeting the nested discard button belong to the button:
- // preventDefault here would swallow Space's synthesized click and
- // navigate instead of discarding.
- if ((event.target as HTMLElement).closest("button")) return;
- if (event.key === "ContextMenu" || (event.shiftKey && event.key === "F10")) {
- event.preventDefault();
- const rect = event.currentTarget.getBoundingClientRect();
- onContextMenu(draftId, { x: rect.left, y: rect.bottom });
- } else if (event.key === "Enter" || event.key === " ") {
- event.preventDefault();