Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CheckboxGroup error style when in ReferenceArrayInput #5953

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
43 changes: 22 additions & 21 deletions packages/ra-ui-materialui/src/input/CheckboxGroupInput.tsx
Expand Up @@ -17,27 +17,6 @@ import classnames from 'classnames';
import Labeled from './Labeled';
import { LinearProgress } from '../layout';

const sanitizeRestProps = ({
setFilter,
setPagination,
setSort,
loaded,
...rest
}: any) => sanitizeInputRestProps(rest);

const useStyles = makeStyles(
theme => ({
root: {},
label: {
transform: 'translate(0, 8px) scale(0.75)',
transformOrigin: `top ${
theme.direction === 'ltr' ? 'left' : 'right'
}`,
},
}),
{ name: 'RaCheckboxGroupInput' }
);

/**
* An Input component for a checkbox group, using an array of objects for the options
*
Expand Down Expand Up @@ -233,6 +212,28 @@ const CheckboxGroupInput: FunctionComponent<
);
};

const sanitizeRestProps = ({
setFilter,
setPagination,
setSort,
loaded,
touched,
...rest
}: any) => sanitizeInputRestProps(rest);

const useStyles = makeStyles(
theme => ({
root: {},
label: {
transform: 'translate(0, 8px) scale(0.75)',
transformOrigin: `top ${
theme.direction === 'ltr' ? 'left' : 'right'
}`,
},
}),
{ name: 'RaCheckboxGroupInput' }
);

CheckboxGroupInput.propTypes = {
choices: PropTypes.arrayOf(PropTypes.object),
className: PropTypes.string,
Expand Down
2 changes: 2 additions & 0 deletions packages/ra-ui-materialui/src/input/sanitizeInputRestProps.ts
Expand Up @@ -8,6 +8,7 @@ const sanitizeInputRestProps = ({
component,
data,
defaultValue,
error,
format,
formatOnBlur,
formClassName,
Expand All @@ -31,6 +32,7 @@ const sanitizeInputRestProps = ({
render,
resource,
source,
submitError,
subscription,
textAlign,
translate,
Expand Down