Skip to content

Commit

Permalink
fix: remove formRadioGroup since the inner field applies the error co…
Browse files Browse the repository at this point in the history
…rrectly
  • Loading branch information
felixmosh committed Jul 27, 2023
1 parent f24a95e commit 4f479c1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 1 addition & 1 deletion src/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Form extends Component<IFormProps & { forwardedRef: any }> {

static RadioGroup = (
props: Omit<IFormsyRadioGroupProps, keyof InjectedProps<any>>
) => <FormsyRadioGroup formRadioGroup {...(props as any)} />;
) => <FormsyRadioGroup {...(props as any)} />;

static Dropdown = (
props: Omit<IFormsyDropdownProps, keyof InjectedProps<any>>
Expand Down
5 changes: 0 additions & 5 deletions src/FormsyRadioGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export interface IFormsyRadioGroupProps
id?: string;
inputClassName?: string;
passRequiredToField?: boolean;
formRadioGroup?: boolean;
defaultSelected?: string;
label?: string | React.ReactNode;
errorLabel?: React.ReactElement;
Expand Down Expand Up @@ -56,7 +55,6 @@ class FormsyRadioGroup extends Component<IFormsyRadioGroupProps> {
as,
label,
required,
formRadioGroup,
children,
name,
value,
Expand Down Expand Up @@ -107,9 +105,6 @@ class FormsyRadioGroup extends Component<IFormsyRadioGroupProps> {
disabled,
};

if (formRadioGroup) {
props.error = error;
}
return (
<Form.Field {...fieldProps}>
{cloneElement(radio, { ...props })}
Expand Down

0 comments on commit 4f479c1

Please sign in to comment.