Skip to content

Commit 6cd5c6a

Browse files
authored
Merge pull request #5953 from marmelab/fix-checkboxgroup-input-error-style-in-reference-input
Fix CheckboxGroup error style when in ReferenceArrayInput
2 parents 5a0903e + 5f6dab8 commit 6cd5c6a

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed

packages/ra-ui-materialui/src/input/CheckboxGroupInput.tsx

+22-21
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,6 @@ import classnames from 'classnames';
1717
import Labeled from './Labeled';
1818
import { LinearProgress } from '../layout';
1919

20-
const sanitizeRestProps = ({
21-
setFilter,
22-
setPagination,
23-
setSort,
24-
loaded,
25-
...rest
26-
}: any) => sanitizeInputRestProps(rest);
27-
28-
const useStyles = makeStyles(
29-
theme => ({
30-
root: {},
31-
label: {
32-
transform: 'translate(0, 8px) scale(0.75)',
33-
transformOrigin: `top ${
34-
theme.direction === 'ltr' ? 'left' : 'right'
35-
}`,
36-
},
37-
}),
38-
{ name: 'RaCheckboxGroupInput' }
39-
);
40-
4120
/**
4221
* An Input component for a checkbox group, using an array of objects for the options
4322
*
@@ -233,6 +212,28 @@ const CheckboxGroupInput: FunctionComponent<
233212
);
234213
};
235214

215+
const sanitizeRestProps = ({
216+
setFilter,
217+
setPagination,
218+
setSort,
219+
loaded,
220+
touched,
221+
...rest
222+
}: any) => sanitizeInputRestProps(rest);
223+
224+
const useStyles = makeStyles(
225+
theme => ({
226+
root: {},
227+
label: {
228+
transform: 'translate(0, 8px) scale(0.75)',
229+
transformOrigin: `top ${
230+
theme.direction === 'ltr' ? 'left' : 'right'
231+
}`,
232+
},
233+
}),
234+
{ name: 'RaCheckboxGroupInput' }
235+
);
236+
236237
CheckboxGroupInput.propTypes = {
237238
choices: PropTypes.arrayOf(PropTypes.object),
238239
className: PropTypes.string,

packages/ra-ui-materialui/src/input/sanitizeInputRestProps.ts

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const sanitizeInputRestProps = ({
88
component,
99
data,
1010
defaultValue,
11+
error,
1112
format,
1213
formatOnBlur,
1314
formClassName,
@@ -31,6 +32,7 @@ const sanitizeInputRestProps = ({
3132
render,
3233
resource,
3334
source,
35+
submitError,
3436
subscription,
3537
textAlign,
3638
translate,

0 commit comments

Comments
 (0)