0
Fork 0
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:
Princi Vershwal 2023-10-25 15:15:14 +05:30 committed by GitHub
parent a20e269a0b
commit 0a2b8cdbd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -63,6 +63,7 @@ const AddIntegrationModal: React.FC<RoutingModalProps> = () => {
marginTop={false}
>
<TextField
autoFocus={true}
error={!!errors.name}
hint={errors.name}
placeholder='Custom integration'

View file

@ -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')}
/>