Removed onBlur error feedback in Custom Integration edit modal (#19383)
Fixes [PROD-268](https://linear.app/tryghost/issue/PROD-268/remove-onblur-error-feedback-in-custom-integration-edit-modal)
This commit is contained in:
parent
255d1b1740
commit
82d9e3a978
@ -20,7 +20,7 @@ const CustomIntegrationModalContent: React.FC<{integration: Integration}> = ({in
|
||||
const {mutateAsync: uploadImage} = useUploadImage();
|
||||
const handleError = useHandleError();
|
||||
|
||||
const {formState, updateForm, handleSave, saveState, errors, clearError, validate, okProps} = useForm({
|
||||
const {formState, updateForm, handleSave, saveState, errors, clearError, okProps} = useForm({
|
||||
initialState: integration,
|
||||
savingDelay: 500,
|
||||
savedDelay: 500,
|
||||
@ -36,7 +36,7 @@ const CustomIntegrationModalContent: React.FC<{integration: Integration}> = ({in
|
||||
const newErrors: Record<string, string> = {};
|
||||
|
||||
if (!formState.name) {
|
||||
newErrors.name = 'Please enter a name';
|
||||
newErrors.name = 'Name is required.';
|
||||
}
|
||||
|
||||
return newErrors;
|
||||
@ -126,7 +126,6 @@ const CustomIntegrationModalContent: React.FC<{integration: Integration}> = ({in
|
||||
hint={errors.name}
|
||||
title='Title'
|
||||
value={formState.name}
|
||||
onBlur={validate}
|
||||
onChange={e => updateForm(state => ({...state, name: e.target.value}))}
|
||||
onKeyDown={() => clearError('name')}
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user