File tree Expand file tree Collapse file tree
src/features/home/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -89,7 +89,18 @@ export function AddConnectionDialog({
8989
9090 return (
9191 < Dialog open = { open } onOpenChange = { handleOpenChange } >
92- < DialogContent className = "sm:max-w-110 max-h-[90vh] overflow-y-auto" >
92+ < DialogContent
93+ className = "sm:max-w-110 max-h-[90vh] overflow-y-auto"
94+ onKeyDown = { ( e ) => {
95+ if ( e . key === "Enter" ) {
96+ const target = e . target as HTMLElement ;
97+ if ( target . tagName !== "BUTTON" && target . tagName !== "A" ) {
98+ e . preventDefault ( ) ;
99+ if ( ! isLoading ) handleSubmit ( ) ;
100+ }
101+ }
102+ } }
103+ >
93104 < DialogHeader >
94105 < DialogTitle className = "flex items-center gap-2" >
95106 < Database className = "h-4 w-4 text-muted-foreground" />
Original file line number Diff line number Diff line change @@ -62,7 +62,21 @@ export function DeleteConnectionDialog({
6262
6363 return (
6464 < Dialog open = { open } onOpenChange = { onOpenChange } >
65- < DialogContent className = "sm:max-w-[425px]" >
65+ < DialogContent
66+ className = "sm:max-w-[425px]"
67+ onKeyDown = { ( e ) => {
68+ if ( e . key === "Enter" ) {
69+ const target = e . target as HTMLElement ;
70+ if ( target . tagName !== "BUTTON" && target . tagName !== "A" ) {
71+ e . preventDefault ( ) ;
72+ if ( ! isDeleting ) {
73+ if ( step === 1 ) handleNext ( ) ;
74+ else handleConfirmDelete ( ) ;
75+ }
76+ }
77+ }
78+ } }
79+ >
6680 < DialogHeader >
6781 { step === 1 ? (
6882 < >
You can’t perform that action at this time.
0 commit comments