Skip to content

Commit

Permalink
fix(ui-grid-menu.js): Give bySelector correct parent.
Browse files Browse the repository at this point in the history
fix #5206
  • Loading branch information
Devin Fields authored and mportuga committed Apr 4, 2018
1 parent c62b986 commit 1972dcc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/js/core/directives/ui-grid-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,14 @@ function ($compile, $timeout, $window, $document, gridUtil, uiGridConstants, i18
$scope.$emit('hide-menu');
} else {
// Maintain focus on the selected item
gridUtil.focus.bySelector(angular.element($event.target.parentElement), 'button[type=button]', true);
var correctParent = $event.target.parentElement;

// nodeName of 'I' means target is i element, need the next parent
if (angular.element($event.target)[0].nodeName === 'I') {
correctParent = correctParent.parentElement;
}

gridUtil.focus.bySelector(correctParent, 'button[type=button]', true);
}
}
};
Expand Down

0 comments on commit 1972dcc

Please sign in to comment.