-
Notifications
You must be signed in to change notification settings - Fork 3.4k
mdList: Enhance mdItem to support ripple and clicks #904
Comments
Need to rename the
|
I disagree! List items are not interactive. The docs sidenav uses anchors and buttons to create interactivity, thereby effectively communicating roles to assistive technologies and making them operable by default. |
@marcysutton maybe it should be called |
That is a separate component. I do not think list-item should be changed. Rather, a menu component should be added. More info copied from the forum: There are accessibility implications with this–list items are not interactive controls. Because the role of a list item is to be a member of a group, it cannot also have a role of button or link. For this reason, please put |
@marcy - you make a good point. While Nevertheless, let's consider the SideNav list on http://material.angularjs.org. <div ng-repeat="section in menu.sections">
<button class="menu-item menu-title md-menu-item"
ng-click="menu.toggleSelectSection(section)"
md-highlight="menu.isSectionSelected(section)"
md-ink-ripple="#bbb">
{{section.name}}
</button>
<a class="menu-item menu-sub-item md-menu-item"
ng-show="menu.isSectionSelected(section)"
ng-repeat="page in section.pages"
ng-href="#{{page.url}}"
md-highlight="menu.isPageSelected(section, page)"
md-ink-ripple="#bbb">
<span ng-bind="page | humanizeDoc"></span>
</a>
</div> This could be so much more nicely represented as: <md-list ng-repeat="section in menu.sections">
<md-list-item ng-click="menu.toggleSelectSection(section)"
md-highlight="menu.isSectionSelected(section)"
md-ink-ripple="#bbb">
{{section.name}} >
</md-list-item>
<md-list-item ng-show="menu.isSectionSelected(section)"
ng-repeat="page in section.pages"
ng-href="#{{page.url}}"
md-highlight="menu.isPageSelected(section, page)"
md-ink-ripple="#bbb">
<span ng-bind="page | humanizeDoc"></span>
</md-list-item>
</md-list> As such, the question becomes: "Should we force the user to explicitly fill the |
@ThomasBurleson we still need to nest an interactive item inside of <md-list ng-repeat="section in menu.sections" role="list">
<md-list-item role="listitem">
<md-button role="button" tabIndex="0" ng-click="menu.toggleSelectSection(section)"
md-highlight="menu.isSectionSelected(section)"
md-ink-ripple="#bbb">
{{section.name}} >
</md-button>
</md-list-item>
<md-list-item role="listitem" ng-show="menu.isSectionSelected(section)"
ng-repeat="page in section.pages">
<md-button role="link" tabIndex="0" ng-href="#{{page.url}}"
md-highlight="menu.isPageSelected(section, page)"
md-ink-ripple="#bbb">
<span ng-bind="page | humanizeDoc"></span>
</md-button>
</md-list-item>
</md-list> However we accomplish this in transclusion is fine, but to me it seems like a lot of extra work when users can just nest |
@marcysutton - so from a ARIA semantic perspective your latest sample seems the right way to use mdList and mdListItem. This is really good to know.
|
That is correct– Questions:
See the design spec for lists. The "Inbox", etc. list looks like a menu, while the Chat contacts list does not: http://www.google.com/design/spec/components/lists.html#lists-specs
|
This will be part of #985. Closing as a duplicate. |
@rschmukler why closing this issue? #985 is a different issue. The approach of @marcysutton (see above) should be at least documented in the md-list section with the correct directives and styling even though I am not convinced that md-button is the correct approach. Be also aware of #1890 - at a certain point we need also swipe functionality on list items. Bottom line best practices are needed to support ripple and clicks. Thanks! |
So, was |
Just don't put Also, this issue is closed...further questions should be asked on the ngMaterial forum. Thanks! |
Sorry for commenting here again, but I think this issue needs to be looked at further. If I put an |
@smaye81 please file a separate issue. |
Just like the one used in the sidenav of documentation site.
See also: related discussion on google group
The text was updated successfully, but these errors were encountered: