Skip to content

Commit

Permalink
Fixed issue of custom page size as 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Arpita Kate committed Apr 29, 2024
1 parent 77c084a commit 6e9d7fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/datagrid/DataGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -656,11 +656,11 @@ export class DataGrid extends React.PureComponent<DataGridProps, DataGridState>
const customPageSize = this.customPageSizeRef.current && this.customPageSizeRef.current.value;

if (pageSize && customPageSize) {
if (!isNumber(customPageSize)) {
if (!isNumber(customPageSize) || parseInt(customPageSize) === 0) {
this.customPageSizeRef.current!.value = pageSize.toString();
} else {
const customPageSizeInt: number = parseInt(customPageSize);
if (pageSize !== customPageSizeInt) {
if (pageSize !== customPageSizeInt && customPageSizeInt > 0) {
if (customPageSizeInt <= maxCustomPageSize) {
this.getPage(currentPage, customPageSizeInt);
}
Expand Down

0 comments on commit 6e9d7fe

Please sign in to comment.