Skip to content

Commit

Permalink
fix: πŸ› fix bug with fieldArray validations
Browse files Browse the repository at this point in the history
fix bug in SQFormInclusionList / field arrays caused by validation error
messages being converted to string arrays.

βœ… Closes: 563
  • Loading branch information
jamesgriffith9519 committed May 20, 2022
1 parent a6ecf5f commit 5de59df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/SQForm/useForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function useForm<TValue, TChangeEvent>({
const hasValue = _getHasValue(meta);
const isError = !!errorMessage;
const isRequired = Array.isArray(errorMessage)
? errorMessage.toString().toLowerCase() === 'required'
? errorMessage.join('').toLowerCase() === 'required'
: errorMessage?.toLowerCase() === 'required';

const getFieldStatus = () => {
Expand Down

0 comments on commit 5de59df

Please sign in to comment.