Skip to content

Commit 93f87d8

Browse files
authored
Merge pull request #6152 from WiXSL/allow-fields-textalign-type
Fix <Field textAlign> prop doesn't accept center
2 parents e0fb207 + 2c44caa commit 93f87d8

File tree

1 file changed

+9
-2
lines changed
  • packages/ra-ui-materialui/src/field

1 file changed

+9
-2
lines changed

packages/ra-ui-materialui/src/field/types.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { ReactElement } from 'react';
22
import { Record } from 'ra-core';
33
import PropTypes from 'prop-types';
4+
import { TableCellProps } from '@material-ui/core/TableCell';
45

5-
type TextAlign = 'right' | 'left';
6+
type TextAlign = TableCellProps['align'];
67
type SortOrder = 'ASC' | 'DESC';
78

89
export interface FieldProps<RecordType extends Record = Record>
@@ -42,6 +43,12 @@ export const fieldPropTypes = {
4243
className: PropTypes.string,
4344
cellClassName: PropTypes.string,
4445
headerClassName: PropTypes.string,
45-
textAlign: PropTypes.oneOf<TextAlign>(['right', 'left']),
46+
textAlign: PropTypes.oneOf<TextAlign>([
47+
'inherit',
48+
'left',
49+
'center',
50+
'right',
51+
'justify',
52+
]),
4653
emptyText: PropTypes.string,
4754
};

0 commit comments

Comments
 (0)