From 0d7d37bb6dfac4be9c6f0fcaccf8d73657417f63 Mon Sep 17 00:00:00 2001 From: imbalind Date: Fri, 27 Nov 2015 16:23:56 +0100 Subject: [PATCH] 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. --- src/js/core/factories/Grid.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/core/factories/Grid.js b/src/js/core/factories/Grid.js index 1b0cd8d392..7b815f3782 100644 --- a/src/js/core/factories/Grid.js +++ b/src/js/core/factories/Grid.js @@ -2332,7 +2332,7 @@ angular.module('ui.grid') //} // This is the minimum amount of pixels we need to scroll vertical in order to see this row. - var pixelsToSeeRow = ((seekRowIndex + 1) * self.options.rowHeight); + var pixelsToSeeRow = (seekRowIndex * self.options.rowHeight + self.headerHeight); // Don't let the pixels required to see the row be less than zero pixelsToSeeRow = (pixelsToSeeRow < 0) ? 0 : pixelsToSeeRow;