-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[Alert] html content breaks up text in Alert #20023
Comments
The presence of |
@simoami Any idea on how we could solve this problem? |
@oliviertassinari There are several ways to fix this but my observation is that the Action button given a large height to show alignment configuration.
My proposed fix in Alert.js message: {
padding: '8px 0',
- display: 'flex',
- flexDirection: 'column',
- justifyContent: 'center',
}, |
Another option is to wrap the inner content in a |
@embeddedt |
@simoami Your proposal sounds great, I would propose the following diff: diff --git a/docs/src/pages/components/alert/DescriptionAlerts.tsx b/docs/src/pages/components/alert/DescriptionAlerts.tsx
index f7a754d8e..da6862d5c 100644
--- a/docs/src/pages/components/alert/DescriptionAlerts.tsx
+++ b/docs/src/pages/components/alert/DescriptionAlerts.tsx
@@ -20,19 +20,19 @@ export default function DescriptionAlerts() {
<div className={classes.root}>
<Alert severity="error">
<AlertTitle>Error</AlertTitle>
- This is an error alert — check it out!
+ This is an error alert — <strong>check it out!</strong>
</Alert>
<Alert severity="warning">
<AlertTitle>Warning</AlertTitle>
- This is a warning alert — check it out!
+ This is a warning alert — <strong>check it out!</strong>
</Alert>
<Alert severity="info">
<AlertTitle>Info</AlertTitle>
- This is an info alert — check it out!
+ This is an info alert — <strong>check it out!</strong>
</Alert>
<Alert severity="success">
<AlertTitle>Success</AlertTitle>
- This is a success alert — check it out!
+ This is a success alert — <strong>check it out!</strong>
</Alert>
</div>
);
diff --git a/packages/material-ui-lab/src/Alert/Alert.js b/packages/material-ui-lab/src/Alert/Alert.js
index 42111972c..fe62631a3 100644
--- a/packages/material-ui-lab/src/Alert/Alert.js
+++ b/packages/material-ui-lab/src/Alert/Alert.js
@@ -123,9 +123,6 @@ export const styles = theme => {
/* Styles applied to the message wrapper element. */
message: {
padding: '8px 0',
- display: 'flex',
- flexDirection: 'column',
- justifyContent: 'center',
},
/* Styles applied to the action wrapper element if `action` is provided. */
action: { The update of the demo can servers as a visual regression test. Do you want to send a pull request? |
Is this up for PR? |
Someone working on it? Or I can start? |
@developerKumar Feel free to go ahead. |
Current Behavior 😯
The content in the Alert component breaks into several lines when html tags are present in the content. For example:
<em>
,<i>
,<strong>
Expected Behavior 🤔
The presence of html content should not cause line breaks. Specifically when using html tags aimed at formatting text.
Steps to Reproduce 🕹
Demo: https://codesandbox.io/s/funny-sun-kxmym
The text was updated successfully, but these errors were encountered: