diff --git a/packages/ra-ui-materialui/src/input/RadioButtonGroupInput.tsx b/packages/ra-ui-materialui/src/input/RadioButtonGroupInput.tsx index 58e9ac998eb..f91021e7a5e 100644 --- a/packages/ra-ui-materialui/src/input/RadioButtonGroupInput.tsx +++ b/packages/ra-ui-materialui/src/input/RadioButtonGroupInput.tsx @@ -159,7 +159,7 @@ const RadioButtonGroupInput: FunctionComponent<RadioButtonGroupInputProps> = pro component="fieldset" margin={margin} error={touched && !!(error || submitError)} - {...sanitizeInputRestProps(rest)} + {...sanitizeRestProps(rest)} > <FormLabel component="legend" className={classes.label}> <FieldTitle @@ -195,7 +195,7 @@ const RadioButtonGroupInput: FunctionComponent<RadioButtonGroupInputProps> = pro }; RadioButtonGroupInput.propTypes = { - choices: PropTypes.arrayOf(PropTypes.any).isRequired, + choices: PropTypes.arrayOf(PropTypes.any), label: PropTypes.string, options: PropTypes.object, optionText: PropTypes.oneOfType([ @@ -217,6 +217,40 @@ RadioButtonGroupInput.defaultProps = { translateChoice: true, }; +const sanitizeRestProps = ({ + addLabel, + afterSubmit, + allowNull, + beforeSubmit, + choices, + className, + crudGetMatching, + crudGetOne, + data, + filter, + filterToQuery, + formatOnBlur, + isEqual, + limitChoicesToValue, + multiple, + name, + pagination, + perPage, + ref, + reference, + render, + setFilter, + setPagination, + setSort, + sort, + subscription, + type, + validateFields, + validation, + value, + ...rest +}: any) => sanitizeInputRestProps(rest); + export type RadioButtonGroupInputProps = ChoicesInputProps<RadioGroupProps> & FormControlProps;