Skip to content

Commit

Permalink
Fix pnp#838
Browse files Browse the repository at this point in the history
  • Loading branch information
IRRDC committed Jul 11, 2024
1 parent 53f6b08 commit aff8abd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/controls/gridLayout/GridLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export class GridLayout extends React.Component<IGridLayoutProps, IGridLayoutSta
if (this._isCompact) {
this._columnCount = 1;
this._columnWidth = surfaceRect.width;
return this.props.items.length;
} else {
this._columnCount = Math.ceil(surfaceRect.width / (MAX_ROW_HEIGHT));
this._columnWidth = Math.max(MIN_WIDTH, Math.floor(surfaceRect.width / this._columnCount) + Math.floor(PADDING / this._columnCount));
Expand All @@ -87,6 +88,9 @@ export class GridLayout extends React.Component<IGridLayoutProps, IGridLayoutSta
* Calculates the page height for the grid
*/
private _getPageHeight = (): number => {
if (this._isCompact) {
return this.props.items.length * this._rowHeight;
}
return this._rowHeight * ROWS_PER_PAGE;
}

Expand Down

0 comments on commit aff8abd

Please sign in to comment.