diff --git a/src/features/edit/js/gridEdit.js b/src/features/edit/js/gridEdit.js index cabccf5b67..bb24f72c6f 100644 --- a/src/features/edit/js/gridEdit.js +++ b/src/features/edit/js/gridEdit.js @@ -765,6 +765,7 @@ } function endEdit(retainFocus) { + $scope.grid.disableScrolling = false; if (!inEdit) { return; } @@ -779,6 +780,7 @@ } function cancelEdit() { + $scope.grid.disableScrolling = false; if (!inEdit) { return; } @@ -867,9 +869,13 @@ $scope.deepEdit = false; }; + $elm.on('click', function (evt) { if ($elm[0].type !== 'checkbox') { $scope.deepEdit = true; + $timeout(function () { + $scope.grid.disableScrolling = true; + }); } }); diff --git a/src/js/core/factories/Grid.js b/src/js/core/factories/Grid.js index 6dbc8fd7c1..5d10b3265a 100644 --- a/src/js/core/factories/Grid.js +++ b/src/js/core/factories/Grid.js @@ -126,6 +126,10 @@ angular.module('ui.grid') */ self.scrollDirection = uiGridConstants.scrollDirection.NONE; + //if true, grid will not respond to any scroll events + self.disableScrolling = false; + + function vertical (scrollEvent) { self.isScrollingVertically = false; self.api.core.raise.scrollEnd(scrollEvent); @@ -313,7 +317,7 @@ angular.module('ui.grid') * @param {number} priority the priority of this processor. In general we try to do them in 100s to leave room * for other people to inject rows processors at intermediate priorities. Lower priority rowsProcessors run earlier. * - * At present allRowsVisible is running at 50, sort manipulations running at 60-65, filter is running at 100, + * At present allRowsVisible is running at 50, sort manipulations running at 60-65, filter is running at 100, * sort is at 200, grouping and treeview at 400-410, selectable rows at 500, pagination at 900 (pagination will generally want to be last) */ self.api.registerMethod( 'core', 'registerRowsProcessor', this.registerRowsProcessor ); diff --git a/src/js/core/factories/GridRenderContainer.js b/src/js/core/factories/GridRenderContainer.js index 1a33f90615..ed7ae2791e 100644 --- a/src/js/core/factories/GridRenderContainer.js +++ b/src/js/core/factories/GridRenderContainer.js @@ -719,6 +719,12 @@ angular.module('ui.grid') var self = this; var styles = {}; + if (self.grid.disableScrolling) { + styles['overflow-x'] = 'hidden'; + styles['overflow-y'] = 'hidden'; + return styles; + } + if (self.name === 'body') { styles['overflow-x'] = self.grid.options.enableHorizontalScrollbar === uiGridConstants.scrollbars.NEVER ? 'hidden' : 'scroll'; if (!self.grid.isRTL()) {