mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -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}
|
||||
>
|
||||
<TextField
|
||||
autoFocus={true}
|
||||
error={!!errors.name}
|
||||
hint={errors.name}
|
||||
placeholder='Custom integration'
|
||||
|
|
|
@ -26,7 +26,7 @@ const AddNewsletterModal: React.FC<RoutingModalProps> = () => {
|
|||
});
|
||||
|
||||
const {mutateAsync: addNewsletter} = useAddNewsletter();
|
||||
const {formState, updateForm, handleSave, errors, validate, clearError} = useForm({
|
||||
const {formState, updateForm, handleSave, errors, clearError} = useForm({
|
||||
initialState: {
|
||||
name: '',
|
||||
description: '',
|
||||
|
@ -96,12 +96,12 @@ const AddNewsletterModal: React.FC<RoutingModalProps> = () => {
|
|||
marginTop
|
||||
>
|
||||
<TextField
|
||||
autoFocus={true}
|
||||
error={Boolean(errors.name)}
|
||||
hint={errors.name}
|
||||
placeholder='Weekly roundup'
|
||||
title='Name'
|
||||
value={formState.name}
|
||||
onBlur={validate}
|
||||
onChange={e => updateForm(state => ({...state, name: e.target.value}))}
|
||||
onKeyDown={() => clearError('name')}
|
||||
/>
|
||||
|
|
Loading…
Add table
Reference in a new issue