Skip to content

Commit fc6c485

Browse files
Merge pull request #14 from philips-emr/fix-row-height
fix: update height correctly.
2 parents 8ab625c + 29e032b commit fc6c485

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

slick.grid.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2900,7 +2900,12 @@
29002900
}
29012901
}
29022902

2903-
th = Math.max(options.rowHeight * numberOfRows, tempViewportH - scrollbarDimensions.height);
2903+
const sumRowsHeight = (options.rowHeights || []).reduce((total, { height }) => total + height, 0);
2904+
const heightLeft = options.rowHeights && options.rowHeights.length ?
2905+
(numberOfRows - options.rowHeights.length) * options.rowHeight :
2906+
(numberOfRows * options.rowHeight);
2907+
2908+
th = Math.max(sumRowsHeight + heightLeft , tempViewportH - scrollbarDimensions.height);
29042909

29052910
if (activeCellNode && activeRow > l) {
29062911
resetActiveCell();

0 commit comments

Comments
 (0)