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 does not pass the disabled class #20343

Closed
2 tasks done
DavidHenri008 opened this issue Mar 30, 2020 · 6 comments · Fixed by #20377
Closed
2 tasks done

MenuItem does not pass the disabled class #20343

DavidHenri008 opened this issue Mar 30, 2020 · 6 comments · Fixed by #20377
Labels
component: menu This is the name of the generic UI component, not the React module! new feature New feature or request ready to take Help wanted. Guidance available. There is a high chance the change will be accepted

Comments

@DavidHenri008
Copy link
Contributor

The MenuItem does not pass the disabled class to the inner ListItem like it does with the dense class name.

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

When a disabled class name is passed to the MenuItem classes property a warning is generated. and the class name is not applied to the disabled menu item.

Expected Behavior 🤔

I would like to be able to pass the disabled class name to the MenuItem classes so it could be relayed to the inner ListItem element, like with the dense class name.

Your Environment 🌎

Tech Version
Material-UI v4.9.7
React v16.13.1
@eps1lon
Copy link
Member

eps1lon commented Mar 30, 2020

That is a general problem with our styling solution and component inheritance. MenuItem implements a different classes prop which means you can't override the classes prop of the ListItem.

Maybe we should start exposing separate props for the classes of the inherited component. This has probably been asked before @oliviertassinari ?

@DavidHenri008
Copy link
Contributor Author

But it is done for the dense class no?

@oliviertassinari oliviertassinari added the component: menu This is the name of the generic UI component, not the React module! label Mar 30, 2020
@eps1lon
Copy link
Member

eps1lon commented Mar 30, 2020

But it is done for the dense class no?

Yeah because Menu handles that class separately. It's not just simply forwarding this class.

A pull request following the approach @oliviertassinari pointed out in #20343 (comment) would be welcome!

@eps1lon eps1lon added new feature New feature or request ready to take Help wanted. Guidance available. There is a high chance the change will be accepted and removed discussion labels Mar 30, 2020
@netochaves
Copy link
Contributor

Can I take this?

@DavidHenri008
Copy link
Contributor Author

Fine for me!
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: menu This is the name of the generic UI component, not the React module! new feature New feature or request ready to take Help wanted. Guidance available. There is a high chance the change will be accepted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants