Skip to content

Commit 0d7d37b

Browse files
committed
fix(core): Fix #4776 scrollTo doesn't work with higher rowHeight
Change the way pixelsToSeeRow variable is calculated. This way is possible to have different heights for rows and column headers.
1 parent f715767 commit 0d7d37b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -2332,7 +2332,7 @@ angular.module('ui.grid')
23322332
//}
23332333

23342334
// This is the minimum amount of pixels we need to scroll vertical in order to see this row.
2335-
var pixelsToSeeRow = ((seekRowIndex + 1) * self.options.rowHeight);
2335+
var pixelsToSeeRow = (seekRowIndex * self.options.rowHeight + self.headerHeight);
23362336

23372337
// Don't let the pixels required to see the row be less than zero
23382338
pixelsToSeeRow = (pixelsToSeeRow < 0) ? 0 : pixelsToSeeRow;

0 commit comments

Comments
 (0)