diff --git a/src/components/list/list.js b/src/components/list/list.js index 8214a2d2556..a04fdbfb3ec 100644 --- a/src/components/list/list.js +++ b/src/components/list/list.js @@ -121,6 +121,11 @@ function mdListItemDirective($mdAria, $mdConstant, $timeout) { container = angular.element('
'); container[0].setAttribute('ng-click', tEl[0].getAttribute('ng-click')); tEl[0].removeAttribute('ng-click'); + + if (tEl[0].getAttribute('aria-label')) { + container[0].setAttribute('aria-label', tEl[0].getAttribute('aria-label')); + tEl[0].removeAttribute('aria-label'); + } container.children().eq(0).append(tEl.contents()); } diff --git a/src/components/list/list.spec.js b/src/components/list/list.spec.js index c70d780b65a..d521002ae21 100644 --- a/src/components/list/list.spec.js +++ b/src/components/list/list.spec.js @@ -68,6 +68,13 @@ describe('mdListItem directive', function() { expect(firstChild.childNodes[0].childNodes[0].nodeName).toBe('P'); }); + it('moves aria-label to primary action', function() { + var listItem = setup(''); + var listItemChildren = listItem.children(); + expect(listItemChildren[0].nodeName).toBe('MD-BUTTON'); + expect(listItemChildren.attr('aria-label')).toBe('Hello'); + }); + it('moves md-secondary items outside of the button', function() { var listItem = setup('

Hello World

'); var firstChild = listItem.children()[0];