Skip to content

Commit 91bf06f

Browse files
committed
fix(uiGridMenu): Only run applyHide when not shown
applyHide() was running on all GRID_SCROLL events, whether or not the menu was visible. This was causing excess $digest() loops.
1 parent 79f6c21 commit 91bf06f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/js/core/directives/ui-grid-menu.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,11 @@ function ($compile, $timeout, $window, $document, gridUtil, uiGridConstants) {
123123

124124
// *** Auto hide when click elsewhere ******
125125
var applyHideMenu = function(){
126-
$scope.$apply(function () {
127-
$scope.hideMenu();
128-
});
126+
if ($scope.shown) {
127+
$scope.$apply(function () {
128+
$scope.hideMenu();
129+
});
130+
}
129131
};
130132

131133
if (typeof($scope.autoHide) === 'undefined' || $scope.autoHide === undefined) {

0 commit comments

Comments
 (0)