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

Commit 358fd98

Browse files
EladBezalelThomasBurleson
authored andcommitted
fix(list): wrapping secondary if it has ng-click
Secondary was being wrapped only if `md-checkbox` or `md-switch` were near by or `ng-click` was applied on the list item. fixes #3928 Closes #5993
1 parent 19a32d0 commit 358fd98

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/components/list/list.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ function mdListItemDirective($mdAria, $mdConstant, $mdUtil, $timeout) {
110110
tEl.addClass('md-no-proxy');
111111
}
112112
}
113+
wrapSecondary();
113114
setupToggleAria();
114115

115116

@@ -142,7 +143,9 @@ function mdListItemDirective($mdAria, $mdConstant, $mdUtil, $timeout) {
142143

143144
tEl[0].setAttribute('tabindex', '-1');
144145
tEl.append(container);
146+
}
145147

148+
function wrapSecondary() {
146149
if (secondaryItem && !isButton(secondaryItem) && secondaryItem.hasAttribute('ng-click')) {
147150
$mdAria.expect(secondaryItem, 'aria-label');
148151
var buttonWrapper = angular.element('<md-button class="md-secondary-container md-icon-button">');
@@ -155,10 +158,10 @@ function mdListItemDirective($mdAria, $mdConstant, $mdUtil, $timeout) {
155158

156159
// Check for a secondary item and move it outside
157160
if ( secondaryItem && (
158-
secondaryItem.hasAttribute('ng-click') ||
161+
secondaryItem.hasAttribute('ng-click') ||
159162
( tAttrs.ngClick &&
160-
isProxiedElement(secondaryItem) )
161-
)) {
163+
isProxiedElement(secondaryItem) )
164+
)) {
162165
tEl.addClass('md-with-secondary');
163166
tEl.append(secondaryItem);
164167
}

0 commit comments

Comments
 (0)