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

[ListItem] allow ListItem to be selected like MenuItem #8667

Closed
phiilu opened this issue Oct 12, 2017 · 6 comments
Closed

[ListItem] allow ListItem to be selected like MenuItem #8667

phiilu opened this issue Oct 12, 2017 · 6 comments
Labels
component: list This is the name of the generic UI component, not the React module! new feature New feature or request

Comments

@phiilu
Copy link
Contributor

phiilu commented Oct 12, 2017

I was wondering, if it would be better if we move the selected prop from the MenuItem directly to the ListItem.

I was using the Drawer component and I wanted to show the user which ListItem was active in the Drawer. So I thought I make it selected, but than I realized the ListItem has no selected prop, but I remebered that the MenuItem has this prop. I looked into the code and saw that the MenuItem is basicly a ListItem.

If we do not think this is a good idea, we should at least tell the user in the docs, when he wants to make a ListItem selected he should use a MenuItem instead.

Your Environment

Tech Version
Material-UI v1.0.0-beta.16
@oliviertassinari oliviertassinari added component: list This is the name of the generic UI component, not the React module! new feature New feature or request labels Oct 12, 2017
@oliviertassinari
Copy link
Member

@phiilu I don't know what to think about this one. I can't see what would be the default list item selected style nor why it should be the same of the menu item. I couldn't find any example of this in Polymer side https://www.webcomponents.org/element/PolymerElements/iron-list
This issue is linked to #5186.

In the uncertainty, I'm closing. We have been using some custom style on the documentation website. (the active page is bold). Thanks for raising this point. I want to collect more feedback before doing anything.

@oliviertassinari oliviertassinari added the waiting for 👍 Waiting for upvotes label Oct 12, 2017
@diogoweb2
Copy link

diogoweb2 commented Oct 20, 2017

I agree with @phiilu. It'd be nice to have "selected" prop on ListItem.

But if you don't think it's a good idea, could someone work on a "Selectable list" implementation like in the previous version (http://www.material-ui.com/#/components/list)

I've tried to implement using List+menuItem but when I click outside from the List, it lost the selection (it makes sense for a menuItem)

*I'm working on something similar to this example: https://material.io/guidelines/layout/structure.html#structure-side-nav
(Right nav on desktop example)

@Leenzur
Copy link

Leenzur commented Oct 23, 2017

Hi everyone, agree with @phiilu too. As a beginner user on material ui, I'm searching how to display a ListItem component easily selected from the responsive demo drawer.

@mystist
Copy link

mystist commented Jan 4, 2018

Try to use the overriding-with-classes for the customization.
That fixed my pain.

@mstrugo
Copy link
Contributor

mstrugo commented Jul 4, 2018

Upvote!

@smrsan76
Copy link

Upvote!
I agree with @phiilu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: list This is the name of the generic UI component, not the React module! new feature New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants