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

Unable to set styles on md-list-item #2012

Closed
johnrbaur opened this issue Nov 28, 2016 · 2 comments · Fixed by #2075
Closed

Unable to set styles on md-list-item #2012

johnrbaur opened this issue Nov 28, 2016 · 2 comments · Fixed by #2075
Assignees

Comments

@johnrbaur
Copy link

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Adding a style or class to an anchor tag with the md-list-item directive should modify the style of the list item.

What is the current behavior?

The style/class is applied to the anchor tag, but not to the inner div elements created by the directive. The applied style is not visible on the page.

What are the steps to reproduce?

http://plnkr.co/edit/B0LLmc7We95gMAuySZbv?p=preview

What is the use-case or motivation for changing an existing behavior?

Adding style to indicate the currently selected item

Which versions of Angular, Material, OS, browsers are affected?

All?

crisbeto added a commit to crisbeto/material2 that referenced this issue Dec 4, 2016
Adds a `display: block` to the list items, in order to prevent them from collapsing. This allows users to set a custom background directly on the list item.

Fixes angular#2012.
@crisbeto crisbeto added the has pr label Dec 4, 2016
@crisbeto
Copy link
Member

crisbeto commented Dec 4, 2016

@johnrbaur That's because the md-list-item has collapsed. Forwarding the styles to the inner elements isn't necessary, you just need to add a display: block. I've put in a PR that should fix it on Material's side.

mmalerba pushed a commit that referenced this issue Dec 7, 2016
Adds a `display: block` to the list items, in order to prevent them from collapsing. This allows users to set a custom background directly on the list item.

Fixes #2012.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants