File tree Expand file tree Collapse file tree
apps/web/src/components/settings Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,7 +93,13 @@ function EnvironmentRenameForm({
9393 } ;
9494
9595 return (
96- < >
96+ < form
97+ className = "flex min-h-0 flex-col"
98+ onSubmit = { ( event ) => {
99+ event . preventDefault ( ) ;
100+ submit ( ) ;
101+ } }
102+ >
97103 < DialogHeader >
98104 < DialogTitle > Rename environment</ DialogTitle >
99105 < DialogDescription >
@@ -110,19 +116,14 @@ function EnvironmentRenameForm({
110116 maxLength = { 64 }
111117 value = { name }
112118 onChange = { ( event ) => setName ( event . target . value ) }
113- onKeyDown = { ( event ) => {
114- if ( event . key === "Enter" ) {
115- event . preventDefault ( ) ;
116- submit ( ) ;
117- }
118- } }
119119 />
120120 </ div >
121121 { lock !== null ? < p className = "text-xs text-muted-foreground" > { lock } </ p > : null }
122122 </ DialogPanel >
123123 < DialogFooter >
124124 { customLabel !== null ? (
125125 < Button
126+ type = "button"
126127 variant = "ghost"
127128 className = "sm:mr-auto"
128129 disabled = { lock !== null }
@@ -131,13 +132,13 @@ function EnvironmentRenameForm({
131132 Use default name
132133 </ Button >
133134 ) : null }
134- < Button variant = "outline" onClick = { onClose } >
135+ < Button type = "button" variant = "outline" onClick = { onClose } >
135136 Cancel
136137 </ Button >
137- < Button disabled = { lock !== null } onClick = { submit } >
138+ < Button type = "submit" disabled = { lock !== null } >
138139 Save
139140 </ Button >
140141 </ DialogFooter >
141- </ >
142+ </ form >
142143 ) ;
143144}
You can’t perform that action at this time.
0 commit comments