diff --git a/src/design-system/composites/CommandPalette/CommandPalette.tsx b/src/design-system/composites/CommandPalette/CommandPalette.tsx index 3baa9be..5cdb0d1 100644 --- a/src/design-system/composites/CommandPalette/CommandPalette.tsx +++ b/src/design-system/composites/CommandPalette/CommandPalette.tsx @@ -194,7 +194,15 @@ export function CommandPalette({ open, onClose, onSelect, data, onOpen, onQueryC if (!open) return null return createPortal( -
+
{ if (e.key === 'Enter' || e.key === ' ') onClose() }} + role="button" + tabIndex={0} + aria-label="Close command palette" + data-testid="command-palette-overlay" + >
e.stopPropagation()} @@ -298,6 +306,12 @@ export function CommandPalette({ open, onClose, onSelect, data, onOpen, onQueryC onSelect(result) onClose() }} + onKeyDown={(e) => { + if (e.key === 'Enter' || e.key === ' ') { + onSelect(result) + onClose() + } + }} onMouseEnter={() => { userNavigated.current = true; setFocusedIdx(flatIdx) }} >
diff --git a/src/design-system/composites/TreeView/TreeView.tsx b/src/design-system/composites/TreeView/TreeView.tsx index 056dc46..5e86331 100644 --- a/src/design-system/composites/TreeView/TreeView.tsx +++ b/src/design-system/composites/TreeView/TreeView.tsx @@ -230,6 +230,10 @@ function TreeNodeRow({ return (
  • + {/* S1082: No onKeyDown here by design — the parent
      carries + onKeyDown={handleKeyDown} which handles Enter (select) and all arrow keys + per the WAI-ARIA tree widget pattern. Adding a duplicate handler here would + fire the action twice. */}
      + {/* S1082: No onKeyDown here by design — the parent
        carries + onKeyDown={handleKeyDown} which handles Enter (navigate) and all arrow keys + per the WAI-ARIA tree widget pattern. Adding a duplicate handler here would + fire the action twice. */}
        { + if (e.key === 'Enter' || e.key === ' ') { + e.preventDefault() + startEdit() + } + }} > {isEmpty ? placeholder : value}