Skip to content

Commit

Permalink
Merge pull request #1851 from IRRDC/dev_838
Browse files Browse the repository at this point in the history
Dev 838
  • Loading branch information
joaojmendes authored Oct 18, 2024
2 parents 4054e99 + 4df9deb commit ad766de
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 ad766de

Please sign in to comment.