Skip to content

Commit

Permalink
Display all error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyEJohnson committed Nov 20, 2024
1 parent 5d395e8 commit 12b828a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/components/forms/uncontrolled/inputTypes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,13 @@ export const Checkbox = ({
</StyledCheckbox>
</CheckboxLine>
<HelpText value={help} />
{error !== undefined && error.length > 0 &&
<StyledErrorMessage>{error[0]}</StyledErrorMessage>
}
{error !== undefined && (
<>
{error.map((msg) => (
<StyledErrorMessage>{msg}</StyledErrorMessage>
))}
</>
)}
</FormInputWrapper>;
};

Expand Down

0 comments on commit 12b828a

Please sign in to comment.