Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 0ef4b79

Browse files
committed
feat(listItem): allow use of own md-buttons
closes #2839
1 parent 1538ebe commit 0ef4b79

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/components/list/list.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function mdListItemDirective($mdAria, $mdConstant, $timeout) {
8686
}
8787
if (hasProxiedElement) {
8888
wrapIn('div');
89-
} else {
89+
} else if (!tEl[0].querySelector('md-button')) {
9090
tEl.addClass('md-no-proxy');
9191
}
9292
} else {

src/components/list/list.spec.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
describe('mdListItem directive', function() {
1+
ddescribe('mdListItem directive', function() {
22
beforeEach(module('material.components.list', 'material.components.checkbox', 'material.components.switch'));
33

44
function setup(html) {
@@ -94,4 +94,9 @@ describe('mdListItem directive', function() {
9494
expect(secondChild.nodeName).toBe('MD-BUTTON');
9595
});
9696

97+
it('should detect non-compiled md-buttons', function() {
98+
var listItem = setup('<md-list-item><md-button ng-click="sayHello()">Hello</md-button></md-list-item>');
99+
expect(listItem.hasClass('md-no-proxy')).toBeFalsy();
100+
});
101+
97102
});

0 commit comments

Comments
 (0)