question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Menu component: Dense prop doesn't change padding

See original GitHub issue

The documentation explains that a “dense” prop may be applied to the Menu component to reduce its padding. It appears to only change the size of the typography component inside it, but doesn’t change the height of the list item or any of its padding.

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

Add a dense prop to a MenuList and the typography component changes from body1 to body2.

Expected Behavior 🤔

Add a dense prop to MenuList and the padding should be reduced, as well as the overall height.

Steps to Reproduce 🕹

I’m only a designer, so I’m inspecting documentation in Chrome and playing with it in code sandbox.

Context 🔦

I want to provide perfect specs to my engineers, and I want to modify components, which requires a perfect understanding of how they’re set up.

Your Environment 🌎

Figma, Chrome.

`npx @mui/envinfo`
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
brookssolveigcommented, Oct 15, 2021

Hey, I’m not a developer, but I’d still like to help you repro this.

  1. First, note that the documentation states “you can use the dense prop to reduce the padding”.
  2. Then, note that any menu with dense applied has the exact same padding as any menu without dense applied.
  3. Note that dense only changes the size of the typography component.

I suggest either updating the documentation’s description to better describe what the prop will do or, better yet, change the behavior of the dense prop. I have an actual need of a smaller menu item, and I’m having to make my own.

0reactions
jatinsandilyacommented, Oct 20, 2021

@siriwatknp @danilo-leal I raised a PR for it. Tested it with generated packages locally as well as compared the Netlify builds. Is there something else that needs to be done to ensure no side effects occur?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Not able to change padding of material UI Select component
I understand that I need to modify nested components but have been unable to find a working solution. <div className='wifi-chooser-column'> < ...
Read more >
[Menu][discussion] Menu height/padding changes in 4.5 ...
In the 4.5 version of Material-UI the height and padding of menu items changed "to better match Google's products" in #17332.
Read more >
Density - Material UI - MUI
This tool allows you to apply density via spacing and component props. You can browse around and see how this applies to the...
Read more >
margin - CSS: Cascading Style Sheets - MDN Web Docs
This property can be used to set a margin on all four sides of an element. Margins create extra space around an element,...
Read more >
List and List Items | Quasar Framework
The QList and QItem are a group of components which can work together to present ... Render an avatar item side (does not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found