-
-
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
[Menu] Remove MenuItem dependency on ListItem #21587
Comments
Might be safe to switch to a padding instead and see what other components are affected by it. |
@jedwards1211 I don't understand, why is this an issue? Why should it behave differently? |
I'm saying the two list items should not behave differently. In the past they didn't, but #15339 caused them to behave differently. I don't know if the spec says anything about menu item height, but according to this quote from #6098 it doesn't sound like there should be any difference in height when using
Would reworking the |
@jedwards1211 Ok, thanks for the extra information. I think that we will need to revamp the List and Menu implementation in v5. One element that has came up is that it's not a good idea to share the same style for both. So I think that we need to stop using this MenuItem > ListItem inheritance. |
Okay. This issue might exist with |
@oliviertassinari for the upcoming ListItem improvement (no matter approach we take), I don't see a need to have // MenuItem.js
const {
component = 'li',
role = 'menuitem',
tabIndex: tabIndexProp,
...other
} = props;
return (
<ListItem
role={role}
tabIndex={tabIndex}
component={component}
/>
) I see 2 ways.
|
@siriwatknp I think that we will always need different components for rendering a list item, a menu item, and maybe a listbox item (select). Because it works in Material Design with the same component doesn't mean it will work in most design systems. I would definitely encourage 2 without any dependency on the list. |
A 4px margin was added to the top and bottom of
ListItemText
in #15339, causing an inconsistency between items that use it and items that just have a string child.Current Behavior 😯
The
MenuItems
in this JSX render with different heights when the viewport width >= 600:When the viewport is narrower than 600px, a media query deactivates and their
minHeight
becomes 48px (ironically causing them to get taller on narrower screens...)Expected Behavior 🤔
The menu items are the same height, like they used to be
Steps to Reproduce 🕹
https://codesandbox.io/s/blazing-resonance-oqiso?file=/src/Demo.js
Context 🔦
Discovered this working on
material-ui-popup-state
demos.Your Environment 🌎
Refer to code sandbox for versions
The text was updated successfully, but these errors were encountered: