Skip to content

Commit

Permalink
fix: textarea errorMessage (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
masopego authored Jan 19, 2023
1 parent 3cfca4c commit 68699f9
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/Questions/Textarea/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,19 @@ const QuestionTextarea = ({ question, useForm }) => {
maxLength: question.registerConfig.maximumLen
})}
/>
{errors[question.name] && errors[question.name].type && (
<ErrorMessage
name={question.name}
sx={{ gridColumn: 1 }}
message={
question.errorMessages &&
question.errorMessages[errors[question.name].type]
}
/>
)}
{errors[question.name] &&
errors[question.name].type &&
question.errorMessages &&
question.errorMessages[errors[question.name].type] && (
<ErrorMessage
name={question.name}
sx={{ gridColumn: 1 }}
message={
question.errorMessages &&
question.errorMessages[errors[question.name].type]
}
/>
)}
{errors[question.name] && errors[question.name].type === 'minLength' && (
<ErrorMessage
name={question.name}
Expand Down

0 comments on commit 68699f9

Please sign in to comment.