@@ -2332,8 +2332,8 @@ angular.module('ui.grid')
2332
2332
2333
2333
/*-- Get the top, left, right, and bottom "scrolled" edges of the grid --*/
2334
2334
2335
- // The top boundary is the current Y scroll position PLUS the header height, because the header can obscure rows when the grid is scrolled downwards
2336
- var topBound = self . renderContainers . body . prevScrollTop + self . headerHeight ;
2335
+ // The top boundary is the current Y scroll position
2336
+ var topBound = self . renderContainers . body . prevScrollTop ;
2337
2337
2338
2338
// Don't the let top boundary be less than 0
2339
2339
topBound = ( topBound < 0 ) ? 0 : topBound ;
@@ -2372,7 +2372,7 @@ angular.module('ui.grid')
2372
2372
// }
2373
2373
2374
2374
// This is the minimum amount of pixels we need to scroll vertical in order to see this row.
2375
- var pixelsToSeeRow = ( seekRowIndex * self . options . rowHeight + self . headerHeight ) ;
2375
+ var pixelsToSeeRow = ( seekRowIndex * self . options . rowHeight ) ;
2376
2376
2377
2377
// Don't let the pixels required to see the row be less than zero
2378
2378
pixelsToSeeRow = ( pixelsToSeeRow < 0 ) ? 0 : pixelsToSeeRow ;
@@ -2399,7 +2399,8 @@ angular.module('ui.grid')
2399
2399
// to get the full position we need
2400
2400
scrollPixels = pixelsToSeeRow - bottomBound + self . renderContainers . body . prevScrollTop ;
2401
2401
2402
- scrollEvent . y = getScrollY ( scrollPixels , scrollLength , self . renderContainers . body . prevScrolltopPercentage ) ;
2402
+ // Scroll to full position plus the height of one row since scrollPixels points to the top pixel of the row
2403
+ scrollEvent . y = getScrollY ( scrollPixels + self . options . rowHeight , scrollLength , self . renderContainers . body . prevScrolltopPercentage ) ;
2403
2404
}
2404
2405
}
2405
2406
0 commit comments