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

Commit c7ff50c

Browse files
committed
fix(listItem): fix menu triggering proxy elements
fixes #4303
1 parent d0e8daf commit c7ff50c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/list/list.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function mdListDirective($mdTheming) {
6464
* </hljs>
6565
*
6666
*/
67-
function mdListItemDirective($mdAria, $mdConstant, $timeout) {
67+
function mdListItemDirective($mdAria, $mdConstant, $mdUtil, $timeout) {
6868
var proxiedTypes = ['md-checkbox', 'md-switch'];
6969
return {
7070
restrict: 'E',
@@ -227,7 +227,8 @@ function mdListItemDirective($mdAria, $mdConstant, $timeout) {
227227

228228
if (proxies.length && firstChild) {
229229
$element.children().eq(0).on('click', function(e) {
230-
if (firstChild.contains(e.target)) {
230+
var parentButton = $mdUtil.getClosest(e.target, 'BUTTON');
231+
if (!parentButton && firstChild.contains(e.target)) {
231232
angular.forEach(proxies, function(proxy) {
232233
if (e.target !== proxy && !proxy.contains(e.target)) {
233234
angular.element(proxy).triggerHandler('click');

0 commit comments

Comments
 (0)