Skip to content

Commit 2e662c1

Browse files
committed
fix: fix dialog focus
1 parent db0d325 commit 2e662c1

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

frontend/testing-view/src/features/keyBindings/components/KeyBindingsDialog.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,14 @@ export const KeyBindingsDialog = ({
5757
return (
5858
<>
5959
<Dialog open={open} onOpenChange={onOpenChange}>
60-
<DialogContent className="w-full min-w-[700px]">
60+
<DialogContent
61+
className="w-full min-w-[700px]"
62+
// onOpenAutoFocus moves focus from the first item's remove button to the dialog itself
63+
onOpenAutoFocus={(e) => {
64+
e.preventDefault();
65+
(e.currentTarget as HTMLElement).focus();
66+
}}
67+
>
6168
<DialogHeader>
6269
<DialogTitle>Key Bindings - {activeWorkspace?.name}</DialogTitle>
6370
<DialogDescription>

0 commit comments

Comments
 (0)