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

Badge cut off when added to MenuItem #21639

Closed
2 tasks done
fzaninotto opened this issue Jul 1, 2020 · 4 comments · Fixed by #21644
Closed
2 tasks done

Badge cut off when added to MenuItem #21639

fzaninotto opened this issue Jul 1, 2020 · 4 comments · Fixed by #21644
Labels
bug 🐛 Something doesn't work component: menu This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process.

Comments

@fzaninotto
Copy link
Contributor

When adding a <Badge> to a <MenuItem>, it appears cut off:

image

  • 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 😯

Badge is cut off

Expected Behavior 🤔

Badge isn't cut off

Steps to Reproduce 🕹

<MenuItem>
    <Badge badgeContent={1} color="error">Posts</Badge>
</MenuItem>

Context 🔦

Adding notifications to a navigation menu is a common use case

Your Environment 🌎

Tech Version
Material-UI v4.4.0
React Latest
Browser Chrome
TypeScript Yes
@fzaninotto fzaninotto added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jul 1, 2020
@oliviertassinari
Copy link
Member

Reproduction on https://codesandbox.io/s/material-demo-0p6l3?file=/demo.tsx. It seems that we can simply remove the overflow style. I don't see any good motivation for this style. Git blame doesn't yield any useful information, the style come from: 9a9ea7e#diff-97d43fceafba5d21cb2646aaa9483e54R16.

diff --git a/packages/material-ui/src/MenuItem/MenuItem.js b/packages/material-ui/src/MenuItem/MenuItem.js
index 2f44f7a75..f0faeedfb 100644
--- a/packages/material-ui/src/MenuItem/MenuItem.js
+++ b/packages/material-ui/src/MenuItem/MenuItem.js
@@ -13,7 +13,6 @@ export const styles = (theme) => ({
     paddingBottom: 6,
     boxSizing: 'border-box',
     width: 'auto',
-    overflow: 'hidden',
     whiteSpace: 'nowrap',
     [theme.breakpoints.up('sm')]: {
       minHeight: 'auto',

@oliviertassinari oliviertassinari added component: menu This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process. bug 🐛 Something doesn't work and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jul 1, 2020
@tj3407
Copy link
Contributor

tj3407 commented Jul 1, 2020

I would like to work on this issue if no one else has started

@fzaninotto
Copy link
Contributor Author

You guys rock, thanks a lot! 💯

@oliviertassinari
Copy link
Member

It will be released in v5.0.0-alpha.2 this weekend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: menu This is the name of the generic UI component, not the React module! 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.

3 participants