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 BooleanField doesn't show label when used in a Show view #6553

Merged
merged 2 commits into from
Sep 8, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions packages/ra-ui-materialui/src/field/BooleanField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,16 @@ const useStyles = makeStyles(

const BooleanField = (props: BooleanFieldProps) => {
const {
addLabel = true,
WiXSL marked this conversation as resolved.
Show resolved Hide resolved
className,
classes: classesOverride,
emptyText,
source,
valueLabelTrue,
valueLabelFalse,
TrueIcon,
FalseIcon,
looseValue,
TrueIcon = DoneIcon,
FalseIcon = ClearIcon,
looseValue = false,
...rest
} = props;
const record = useRecordContext(props);
Expand Down Expand Up @@ -84,13 +85,6 @@ const BooleanField = (props: BooleanFieldProps) => {
);
};

BooleanField.defaultProps = {
addLabel: true,
TrueIcon: DoneIcon,
FalseIcon: ClearIcon,
looseValue: false,
};

BooleanField.propTypes = {
// @ts-ignore
...Typography.propTypes,
Expand Down