Skip to content

Commit b01588e

Browse files
committed
Bugfix for issue #838
Bugfix for issue #838. When in compact mode the number of items rendered per page must match the number of all items.
1 parent 3e3d0b5 commit b01588e

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/controls/gridLayout/GridLayout.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export class GridLayout extends React.Component<IGridLayoutProps, IGridLayoutSta
7373
if (this._isCompact) {
7474
this._columnCount = 1;
7575
this._columnWidth = surfaceRect.width;
76+
return this.props.items.length;
7677
} else {
7778
this._columnCount = Math.ceil(surfaceRect.width / (MAX_ROW_HEIGHT));
7879
this._columnWidth = Math.max(MIN_WIDTH, Math.floor(surfaceRect.width / this._columnCount) + Math.floor(PADDING / this._columnCount));
@@ -87,6 +88,9 @@ export class GridLayout extends React.Component<IGridLayoutProps, IGridLayoutSta
8788
* Calculates the page height for the grid
8889
*/
8990
private _getPageHeight = (): number => {
91+
if (this._isCompact) {
92+
return this.props.items.length * this._rowHeight;
93+
}
9094
return this._rowHeight * ROWS_PER_PAGE;
9195
}
9296

0 commit comments

Comments
 (0)