@@ -2440,7 +2440,7 @@ angular.module('ui.grid')
2440
2440
if ( gridRow !== null ) {
2441
2441
// This is the index of the row we want to scroll to, within the list of rows that can be visible
2442
2442
var seekRowIndex = visRowCache . indexOf ( gridRow ) ;
2443
-
2443
+
2444
2444
// Total vertical scroll length of the grid
2445
2445
var scrollLength = ( self . renderContainers . body . getCanvasHeight ( ) - self . renderContainers . body . getViewportHeight ( ) ) ;
2446
2446
@@ -2472,13 +2472,15 @@ angular.module('ui.grid')
2472
2472
scrollEvent . y = getScrollY ( scrollPixels , scrollLength , self . renderContainers . body . prevScrolltopPercentage ) ;
2473
2473
}
2474
2474
// 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...
2475
- else if ( pixelsToSeeRow > Math . ceil ( bottomBound ) ) {
2475
+ // add the height of one row since scrollPixels points to the top pixel of the row
2476
+ else if ( ( pixelsToSeeRow + self . options . rowHeight ) > Math . ceil ( bottomBound ) ) {
2476
2477
// Get the different between the bottom boundary and the required scroll position and add it to the current scroll position
2477
- // to get the full position we need
2478
- scrollPixels = pixelsToSeeRow - bottomBound + self . renderContainers . body . prevScrollTop ;
2478
+ // plus the height of one row since scrollPixels points to the top pixel of the row
2479
+ // to get the full position we need
2480
+ scrollPixels = ( pixelsToSeeRow + self . options . rowHeight ) - bottomBound + self . renderContainers . body . prevScrollTop ;
2479
2481
2480
- // Scroll to full position plus the height of one row since scrollPixels points to the top pixel of the row
2481
- scrollEvent . y = getScrollY ( scrollPixels + self . options . rowHeight , scrollLength , self . renderContainers . body . prevScrolltopPercentage ) ;
2482
+ // Scroll to full position
2483
+ scrollEvent . y = getScrollY ( scrollPixels , scrollLength , self . renderContainers . body . prevScrolltopPercentage ) ;
2482
2484
}
2483
2485
}
2484
2486
0 commit comments