@@ -116,7 +116,18 @@ function mdListDirective($mdTheming) {
116
116
* - `md-menu` (Open)
117
117
*
118
118
* This means, when using a supported proxy item inside of `md-list-item`, the list item will
119
- * become clickable and executes the associated action of the proxy element on click.
119
+ * automatically become clickable and executes the associated action of the proxy element on click.
120
+ *
121
+ * It is possible to disable this behavior by applying the `md-no-proxy` class to the list item.
122
+ *
123
+ * <hljs lang="html">
124
+ * <md-list-item class="md-no-proxy">
125
+ * <span>No Proxy List</span>
126
+ * <md-checkbox class="md-secondary"></md-checkbox>
127
+ * </md-list-item>
128
+ * </hljs>
129
+ *
130
+ * Here are a few examples of proxy elements inside of a list item.
120
131
*
121
132
* <hljs lang="html">
122
133
* <md-list-item>
@@ -233,18 +244,21 @@ function mdListItemDirective($mdAria, $mdConstant, $mdUtil, $timeout) {
233
244
234
245
if ( tAttrs . ngClick || tAttrs . ngDblclick || tAttrs . ngHref || tAttrs . href || tAttrs . uiSref || tAttrs . ngAttrUiSref ) {
235
246
wrapIn ( 'button' ) ;
236
- } else {
247
+ } else if ( ! tEl . hasClass ( 'md-no-proxy' ) ) {
248
+
237
249
for ( var i = 0 , type ; type = proxiedTypes [ i ] ; ++ i ) {
238
250
if ( proxyElement = tEl [ 0 ] . querySelector ( type ) ) {
239
251
hasProxiedElement = true ;
240
252
break ;
241
253
}
242
254
}
255
+
243
256
if ( hasProxiedElement ) {
244
257
wrapIn ( 'div' ) ;
245
- } else if ( ! tEl [ 0 ] . querySelector ( 'md-button:not(.md-secondary):not(.md-exclude)' ) ) {
258
+ } else {
246
259
tEl . addClass ( 'md-no-proxy' ) ;
247
260
}
261
+
248
262
}
249
263
250
264
wrapSecondaryItems ( ) ;
@@ -430,12 +444,13 @@ function mdListItemDirective($mdAria, $mdConstant, $mdUtil, $timeout) {
430
444
firstElement = $element [ 0 ] . firstElementChild ,
431
445
isButtonWrap = $element . hasClass ( '_md-button-wrap' ) ,
432
446
clickChild = isButtonWrap ? firstElement . firstElementChild : firstElement ,
433
- hasClick = clickChild && hasClickEvent ( clickChild ) ;
447
+ hasClick = clickChild && hasClickEvent ( clickChild ) ,
448
+ noProxies = $element . hasClass ( 'md-no-proxy' ) ;
434
449
435
450
computeProxies ( ) ;
436
451
computeClickable ( ) ;
437
452
438
- if ( $element . hasClass ( 'md-proxy-focus' ) && proxies . length ) {
453
+ if ( proxies . length ) {
439
454
angular . forEach ( proxies , function ( proxy ) {
440
455
proxy = angular . element ( proxy ) ;
441
456
@@ -458,7 +473,8 @@ function mdListItemDirective($mdAria, $mdConstant, $mdUtil, $timeout) {
458
473
459
474
460
475
function computeProxies ( ) {
461
- if ( firstElement && firstElement . children && ! hasClick ) {
476
+
477
+ if ( firstElement && firstElement . children && ! hasClick && ! noProxies ) {
462
478
463
479
angular . forEach ( proxiedTypes , function ( type ) {
464
480
0 commit comments