-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[Dialog] The h6 DialogTitle class is applied to dialog titles instead of h2 #26386
Comments
After reading trough the discussion, I think that we should replace the variant to correspond to the tag used: index 8837d98d39..817595e0f3 100644
--- a/packages/material-ui/src/DialogTitle/DialogTitle.js
+++ b/packages/material-ui/src/DialogTitle/DialogTitle.js
@@ -50,7 +50,7 @@ const DialogTitle = React.forwardRef(function DialogTitle(inProps, ref) {
{disableTypography ? (
children
) : (
- <Typography component="h2" variant="h6">
+ <Typography component="h2" variant="h2">
{children}
</Typography>
)} Tagging @oliviertassinari as he was leading the initial discussion. |
h6 is the correct typography variant, per https://material.io/components/dialogs#simple-dialog.
@Anna-log7 Do you have material to support this claim? More importantly, what's your root pain point? What problem are you trying to solve? This issue might be a bit related to #19696. |
From what I can tell after reading that page,
This page in the documentation https://material-ui.com/api/dialog-title/ lists |
Interesting, the h2 in the API description is a reference to the DOM node. The pain you have seem very much something we aim to fix in #19696. And if I understand it correctly, you want to customize the typography variant of the DialogTitle in the theme. |
Fixed in #26323 |
The documentation and code both indicate that an h2 should be the default variant for
DialogTitle
, but the h6 class is applied.This line of code has the component set to h2, but the variant set as h6.
https://github.com/mui-org/material-ui/blob/7df94e4235fc6fc98ec7c13710be45bdbbd86dbe/packages/material-ui/src/DialogTitle/DialogTitle.js#L24
This results in
<h2 class="MuiTypography-root MuiTypography-h6"></h2>
Also see this related closed issue: #16569
Current Behavior 😯
.MuiTypography-h6
class is set on theDialogTitle
Expected Behavior 🤔
.MuiTypography-h2
class should be set on theDialogTitle
Steps to Reproduce 🕹
https://codesandbox.io/s/h6-bug-323pj?file=/demo.js
Context 🔦
Our h6 styling is much smaller causing the dialog titles to not stand out as expected.
Your Environment 🌎
`npx @material-ui/envinfo`
The text was updated successfully, but these errors were encountered: