Fix gallery card list bug (#87)

This commit is contained in:
Tanuj Mittal 2020-07-15 09:27:27 -07:00 committed by GitHub
parent f6938f5ec5
commit db0b478eb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -389,8 +389,10 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
}
private getPageSpecification = (itemIndex?: number, visibleRect?: IRectangle): IPageSpecification => {
this.columnCount = Math.floor(visibleRect.width / GalleryCardComponent.CARD_WIDTH);
this.rowCount = Math.floor(visibleRect.height / GalleryCardComponent.CARD_HEIGHT);
if (itemIndex === 0) {
this.columnCount = Math.floor(visibleRect.width / GalleryCardComponent.CARD_WIDTH) || this.columnCount;
this.rowCount = Math.ceil(visibleRect.height / GalleryCardComponent.CARD_HEIGHT) || this.rowCount;
}
return {
height: visibleRect.height,