diff --git a/ui/v2.5/src/components/List/ListFilter.tsx b/ui/v2.5/src/components/List/ListFilter.tsx index 52a0cf44c..1b6237aeb 100644 --- a/ui/v2.5/src/components/List/ListFilter.tsx +++ b/ui/v2.5/src/components/List/ListFilter.tsx @@ -24,6 +24,7 @@ import { FormattedMessage, useIntl } from "react-intl"; import { PersistanceLevel } from "src/hooks/ListHook"; import { SavedFilterList } from "./SavedFilterList"; +const maxPageSize = 1000; interface IListFilterProps { onFilterUpdate: (newFilter: ListFilterModel) => void; filter: ListFilterModel; @@ -90,11 +91,16 @@ export const ListFilter: React.FC = ({ setCustomPageSizeShowing(false); - const pp = parseInt(val, 10); + let pp = parseInt(val, 10); if (Number.isNaN(pp) || pp <= 0) { return; } + // don't allow page sizes over 1000 + if (pp > maxPageSize) { + pp = maxPageSize; + } + const newFilter = _.cloneDeep(filter); newFilter.itemsPerPage = pp; newFilter.currentPage = 1; @@ -334,6 +340,7 @@ export const ListFilter: React.FC = ({ ) => {