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.

Document how to use secondary actions in lists

See original GitHub issue

Bug, feature request, or proposal:

Improved documentation

What is the expected behavior?

It should be possible to include one or more buttons (or “infos”) as a secondary action in a list item per the spec.

What is the current behavior?

The List documentation and examples do not show secondary actions.

Is there anything else we should know?

The documentation for Lists in Material 1 show extensive examples, including (at the very end) the use of multiple secondary actions, via the md-secondary class. I’m guessing this is probably already possible in Material 2 but I can’t figure out how. (For the time being, I’m hacking it together with manual float:right and some margin twiddling.)

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:5
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
jotatoledocommented, Feb 12, 2018

I just came across this issue while trying to reproduce one of the examples of materialjs, specifically the one that @thw0rted pointed out. Would be nice to hear from the dev team if its currently possible to archive the same with the current implementation of mat-list. I currently implemented something but I had to invoke stopPropagation to not trigger the “main” action binded to the mat-list-item.

1reaction
BobBDEcommented, Aug 10, 2017

Hi,

I think it’s possible if we look at the demo app : https://material2-test.firebaseapp.com/list You can find the linked code over here : https://github.com/angular/material2/blob/master/src/demo-app/list/list-demo.html

Looks like something like this : <md-nav-list> <md-list-item *ngFor="let link of links"> <a md-line href="http://www.google.com">{{ link.name }}</a> <button md-icon-button (click)="infoClicked=!infoClicked"> <md-icon>info</md-icon> </button> </md-list-item> </md-nav-list>

I think this also work with the classic md-list, not only for the md-nav_list

Read more comments on GitHub >

github_iconTop Results From Across the Web

Have two secondary action elements in a list - Stack Overflow
It is almost sufficient to just put both actions in one ListItemSecondaryAction (as indicated by comments and another answer).
Read more >
Primary & Secondary Action Buttons | by Nick Babich | UX Planet
When a Primary Action Is Positive ('Send' or 'Submit') ... The primary action associated shoud have a stronger visual weight. Secondary actions should...
Read more >
ListItemSecondaryAction API - Material-UI
The API documentation of the ListItemSecondaryAction React component. Learn more about the props and the CSS customization points.
Read more >
Material Design the correct way to work with primary and ...
If I understand correctly the Expand(secondary action) only becomes available ... check this example from MD Lists documentation picture 2.
Read more >
Appendix B: Narrator keyboard commands and touch gestures
To view a list of all other keyboard shortcuts in Windows, see Keyboard ... You can use either of these keys in any...
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