Skip to content

Commit

Permalink
Addressed code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Arpita Kate committed Apr 29, 2024
1 parent e7ba832 commit 77c084a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/datagrid/DataGrid.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ storiesOf("DataGrid", module)
/>
</div>
))
.add("Grid with pagination and pageSizes dropdown", () => (
.add("Grid with pagination and custom page size", () => (
<div style={{width: "80%"}}>
<DataGrid
columns={normalColumns}
Expand Down
7 changes: 3 additions & 4 deletions src/datagrid/DataGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -664,11 +664,10 @@ export class DataGrid extends React.PureComponent<DataGridProps, DataGridState>
if (customPageSizeInt <= maxCustomPageSize) {
this.getPage(currentPage, customPageSizeInt);
}
//If page size selected by user is greater than maximum limit for custom page size
// If page size selected by user is greater than maximum limit for custom page size
else if (customPageSizeInt > maxCustomPageSize && this.customPageSizeRef.current) {
this.customPageSizeRef.current.value =
totalItems < maxCustomPageSize ? totalItems.toString() : maxCustomPageSize.toString();
this.getPage(DEFAULT_CURRENT_PAGE_NUMBER, customPageSizeInt);
const newCustomPageSize = totalItems < maxCustomPageSize ? totalItems : maxCustomPageSize;
this.getPage(DEFAULT_CURRENT_PAGE_NUMBER, newCustomPageSize);
}
}
}
Expand Down

0 comments on commit 77c084a

Please sign in to comment.