Skip to content

Commit

Permalink
Fixes #37644 - Pagination doesnt update between react pages
Browse files Browse the repository at this point in the history
  • Loading branch information
MariaAga committed Jul 11, 2024
1 parent e78bd15 commit 8ccee35
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ const Pagination = ({
let nextPage = propsPage;
let nextPerPage = propsPerPage;
if (updateParamsByUrl) {
if (search !== undefined) {
if (search !== undefined && search.length) {
const params = new URLSearchParams(search);
nextPage = Number(params.get('page'));
nextPerPage = Number(params.get('per_page'));
nextPage = Number(params.get('page') || getURIpage());
nextPerPage = Number(params.get('per_page') || getURIperPage());
} else {
nextPage = getURIpage();
nextPerPage = getURIperPage();
Expand Down Expand Up @@ -105,6 +105,7 @@ const Pagination = ({
const cx = classNames('tfm-pagination', className, {
'no-side-padding': noSidePadding,
});

return (
<PF4Pagination
titles={paginationTitles}
Expand Down

0 comments on commit 8ccee35

Please sign in to comment.