Skip to content

Commit 16826bf

Browse files
macomagemportuga
authored andcommitted
fix(Grid.js): ScrollIfNecessary does not account for scrollWidth correctly
Since scrollIfNecessary is called multiple times when enableCellEditOnFocus is true we need to make sure the scrollbarWidth and footerHeight is accounted for to not cause a loop. fixes #6653
1 parent 8e6aebf commit 16826bf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: src/js/core/factories/Grid.js

+5
Original file line numberDiff line numberDiff line change
@@ -2444,6 +2444,11 @@ angular.module('ui.grid')
24442444
// to get the full position we need
24452445
scrollPixels = self.renderContainers.body.prevScrollTop - (topBound - pixelsToSeeRow);
24462446

2447+
//Since scrollIfNecessary is called multiple times when enableCellEditOnFocus is true we need to make sure the scrollbarWidth and footerHeight is accounted for to not cause a loop.
2448+
if (gridCol.colDef.enableCellEditOnFocus === true) {
2449+
scrollPixels = scrollPixels - self.footerHeight - self.scrollbarWidth;
2450+
}
2451+
24472452
scrollEvent.y = getScrollY(scrollPixels, scrollLength, self.renderContainers.body.prevScrolltopPercentage);
24482453
}
24492454
// Otherwise if the scroll position we need to see the row is MORE than the bottom boundary, i.e. obscured below the bottom of the self...

0 commit comments

Comments
 (0)