diff --git a/web/apps/photos/src/components/DeleteAccount.tsx b/web/apps/photos/src/components/DeleteAccount.tsx index b7f59e9207..f165c589a4 100644 --- a/web/apps/photos/src/components/DeleteAccount.tsx +++ b/web/apps/photos/src/components/DeleteAccount.tsx @@ -51,7 +51,7 @@ export const DeleteAccount: React.FC = ({ { reason: string; feedback: string } | undefined >(undefined); - const { values, errors, handleChange, handleSubmit } = useFormik({ + const { values, touched, errors, handleChange, handleSubmit } = useFormik({ initialValues: { reason: "", feedback: "" }, validate: ({ reason, feedback }) => { if (!reason) return { reason: t("required") }; @@ -149,7 +149,7 @@ export const DeleteAccount: React.FC = ({ selected={values.reason} onSelect={handleChange("reason")} /> - {errors.reason && ( + {touched.reason && errors.reason && ( = ({ [] => interface FeedbackInputProps { value: string; - errorMessage?: string; + errorMessage?: string | undefined; onChange: (value: string) => void; } @@ -242,9 +244,14 @@ const FeedbackInput: React.FC = ({ }, }} /> - - {errorMessage} - + {errorMessage && ( + + {errorMessage} + + )} );