diff --git a/src/components/list/list.js b/src/components/list/list.js index a04fdbfb3ec..f3a98807edb 100644 --- a/src/components/list/list.js +++ b/src/components/list/list.js @@ -86,7 +86,7 @@ function mdListItemDirective($mdAria, $mdConstant, $timeout) { } if (hasProxiedElement) { wrapIn('div'); - } else { + } else if (!tEl[0].querySelector('md-button')) { tEl.addClass('md-no-proxy'); } } else { diff --git a/src/components/list/list.spec.js b/src/components/list/list.spec.js index 7a90623da3b..23efaab2977 100644 --- a/src/components/list/list.spec.js +++ b/src/components/list/list.spec.js @@ -1,4 +1,4 @@ -describe('mdListItem directive', function() { +ddescribe('mdListItem directive', function() { beforeEach(module('material.components.list', 'material.components.checkbox', 'material.components.switch')); function setup(html) { @@ -94,4 +94,9 @@ describe('mdListItem directive', function() { expect(secondChild.nodeName).toBe('MD-BUTTON'); }); + it('should detect non-compiled md-buttons', function() { + var listItem = setup('Hello'); + expect(listItem.hasClass('md-no-proxy')).toBeFalsy(); + }); + });