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 EmailField font size differs from other fields #6567

Merged
merged 2 commits into from
Sep 9, 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
Next Next commit
Fix EmailField font size differs from other fields
Closes #6566
fzaninotto committed Sep 9, 2021
commit f7bdbe7c58f5b3f540b6f157c0b59db1adb632e2
10 changes: 8 additions & 2 deletions packages/ra-ui-materialui/src/field/EmailField.tsx
Original file line number Diff line number Diff line change
@@ -34,9 +34,15 @@ const EmailField = memo<EmailFieldProps>((props: EmailFieldProps) => {
className={className}
href={`mailto:${value}`}
onClick={stopPropagation}
{...sanitizeFieldRestProps(rest)}
>
{value}
<Typography
component="span"
variant="body2"
className={className}
{...sanitizeFieldRestProps(rest)}
>
{value}
</Typography>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can pass these props directly to the Link component. See the example above this link: https://material-ui.com/components/links/#api

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should I? The props have to end up in the Typography element anyway.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nevermind, you're right, I'll change that.

</Link>
);
});