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

[MenuItem] MenuItem text is not correctly centered in IE11 #17323

Closed
2 tasks done
damir-sirola opened this issue Sep 5, 2019 · 3 comments · Fixed by #17332
Closed
2 tasks done

[MenuItem] MenuItem text is not correctly centered in IE11 #17323

damir-sirola opened this issue Sep 5, 2019 · 3 comments · Fixed by #17332
Labels
bug 🐛 Something doesn't work good first issue Great for first contributions. Enable to learn the contribution process.

Comments

@damir-sirola
Copy link
Contributor

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

MenuItem text is not vertically aligned
image

Expected Behavior 🤔

MenuItem text is vertically aligned
image

Steps to Reproduce 🕹

Steps:

  1. Open https://material-ui.com/components/menus/ in IE11
  2. Expand menu in any example

Context 🔦

Your Environment 🌎

Tech Version
Material-UI v4.4.0
React 16.9.0
Browser IE11
TypeScript 3.5.3
etc.
@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work good first issue Great for first contributions. Enable to learn the contribution process. labels Sep 5, 2019
@oliviertassinari
Copy link
Member

@damir-sirola Thanks for the report, it comes from this weird IE 11 bug: philipwalton/flexbugs#231. What do you think of this fix? Do you want to submit a pull request? :)

diff --git a/packages/material-ui/src/MenuItem/MenuItem.js b/packages/material-ui/src/MenuItem/MenuItem.js
index f62a2cc9a5..9f771201a1 100644
--- a/packages/material-ui/src/MenuItem/MenuItem.js
+++ b/packages/material-ui/src/MenuItem/MenuItem.js
@@ -15,6 +15,13 @@ export const styles = theme => ({
     width: 'auto',
     overflow: 'hidden',
     whiteSpace: 'nowrap',
+    // Fix IE 11 issue (minHeight conflict)
+    '&:after': {
+      display: 'block',
+      content: '""',
+      fontSize: 0,
+      minHeight: 'inherit',
+    },
   },
   /* Styles applied to the root element if `disableGutters={false}`. */
   gutters: {

@paras151
Copy link
Contributor

paras151 commented Sep 8, 2019

I am a beginner and havent contributed to open source , but would really love to , can anyone help please help me to get started in open source.I have good knowledge of html,css and basic backend web development

@joshwooding
Copy link
Member

@paras151 Sure, it might be better to do this over pm on either Spectrum or Gitter. Have you read https://github.com/mui-org/material-ui/blob/master/CONTRIBUTING.md ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work good first issue Great for first contributions. Enable to learn the contribution process.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants