File tree 2 files changed +6
-4
lines changed
frontend/components/environments
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,9 @@ export const CreateEnvironmentDialog = (props: { appId: string }) => {
55
55
const [ createEnvironment , { loading } ] = useMutation ( CreateEnv )
56
56
57
57
const [ name , setName ] = useState ( '' )
58
+
58
59
const dialogRef = useRef < { closeModal : ( ) => void } > ( null )
60
+ const inputRef = useRef ( null )
59
61
60
62
const handleSubmit = async ( event : { preventDefault : ( ) => void } ) => {
61
63
event . preventDefault ( )
@@ -125,6 +127,7 @@ export const CreateEnvironmentDialog = (props: { appId: string }) => {
125
127
< FaPlus /> New Environment
126
128
</ div >
127
129
}
130
+ initialFocus = { inputRef }
128
131
>
129
132
< form className = "space-y-4 py-4" onSubmit = { handleSubmit } >
130
133
< div >
@@ -142,7 +145,7 @@ export const CreateEnvironmentDialog = (props: { appId: string }) => {
142
145
label = "Environment name"
143
146
required
144
147
maxLength = { 32 }
145
- data-autofocus
148
+ ref = { inputRef }
146
149
/>
147
150
< p className = "text-xs text-neutral-500" >
148
151
Use up to 32 characters. Only letters, numbers, hyphens and underscores allowed.
Original file line number Diff line number Diff line change @@ -69,15 +69,14 @@ const RenameEnvironment = (props: { environment: EnvironmentType }) => {
69
69
? 'Upgrade to Pro to rename Environments'
70
70
: "You don't have the permissions required to rename this Environment" }
71
71
</ Alert >
72
-
72
+
73
73
< div className = "space-y-2" >
74
74
< Input
75
75
value = { sanitizeInput ( name ) }
76
76
setValue = { setName }
77
77
label = "Environment name"
78
78
required
79
79
maxLength = { 32 }
80
- data-autofocus
81
80
disabled = { ! allowRename }
82
81
/>
83
82
{ allowRename && (
@@ -86,7 +85,7 @@ const RenameEnvironment = (props: { environment: EnvironmentType }) => {
86
85
</ p >
87
86
) }
88
87
</ div >
89
-
88
+
90
89
{ allowRename && (
91
90
< div className = "flex justify-end" >
92
91
< Button type = "submit" variant = "primary" disabled = { name === props . environment . name } >
You can’t perform that action at this time.
0 commit comments