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

Commit

Permalink
fix(listItem): fix menu triggering proxy elements
Browse files Browse the repository at this point in the history
fixes #4303
  • Loading branch information
rschmukler committed Sep 15, 2015
1 parent d0e8daf commit c7ff50c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/list/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function mdListDirective($mdTheming) {
* </hljs>
*
*/
function mdListItemDirective($mdAria, $mdConstant, $timeout) {
function mdListItemDirective($mdAria, $mdConstant, $mdUtil, $timeout) {
var proxiedTypes = ['md-checkbox', 'md-switch'];
return {
restrict: 'E',
Expand Down Expand Up @@ -227,7 +227,8 @@ function mdListItemDirective($mdAria, $mdConstant, $timeout) {

if (proxies.length && firstChild) {
$element.children().eq(0).on('click', function(e) {
if (firstChild.contains(e.target)) {
var parentButton = $mdUtil.getClosest(e.target, 'BUTTON');
if (!parentButton && firstChild.contains(e.target)) {
angular.forEach(proxies, function(proxy) {
if (e.target !== proxy && !proxy.contains(e.target)) {
angular.element(proxy).triggerHandler('click');
Expand Down

0 comments on commit c7ff50c

Please sign in to comment.