mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-27 22:49:56 -05:00
Added autoFocus to AddNewsLetter and AddIntegration Modal (#18751)
This commit is contained in:
parent
a20e269a0b
commit
0a2b8cdbd3
2 changed files with 3 additions and 2 deletions
|
@ -63,6 +63,7 @@ const AddIntegrationModal: React.FC<RoutingModalProps> = () => {
|
||||||
marginTop={false}
|
marginTop={false}
|
||||||
>
|
>
|
||||||
<TextField
|
<TextField
|
||||||
|
autoFocus={true}
|
||||||
error={!!errors.name}
|
error={!!errors.name}
|
||||||
hint={errors.name}
|
hint={errors.name}
|
||||||
placeholder='Custom integration'
|
placeholder='Custom integration'
|
||||||
|
|
|
@ -26,7 +26,7 @@ const AddNewsletterModal: React.FC<RoutingModalProps> = () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const {mutateAsync: addNewsletter} = useAddNewsletter();
|
const {mutateAsync: addNewsletter} = useAddNewsletter();
|
||||||
const {formState, updateForm, handleSave, errors, validate, clearError} = useForm({
|
const {formState, updateForm, handleSave, errors, clearError} = useForm({
|
||||||
initialState: {
|
initialState: {
|
||||||
name: '',
|
name: '',
|
||||||
description: '',
|
description: '',
|
||||||
|
@ -96,12 +96,12 @@ const AddNewsletterModal: React.FC<RoutingModalProps> = () => {
|
||||||
marginTop
|
marginTop
|
||||||
>
|
>
|
||||||
<TextField
|
<TextField
|
||||||
|
autoFocus={true}
|
||||||
error={Boolean(errors.name)}
|
error={Boolean(errors.name)}
|
||||||
hint={errors.name}
|
hint={errors.name}
|
||||||
placeholder='Weekly roundup'
|
placeholder='Weekly roundup'
|
||||||
title='Name'
|
title='Name'
|
||||||
value={formState.name}
|
value={formState.name}
|
||||||
onBlur={validate}
|
|
||||||
onChange={e => updateForm(state => ({...state, name: e.target.value}))}
|
onChange={e => updateForm(state => ({...state, name: e.target.value}))}
|
||||||
onKeyDown={() => clearError('name')}
|
onKeyDown={() => clearError('name')}
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Add table
Reference in a new issue