Skip to content

Commit

Permalink
fix: page overflow while searching
Browse files Browse the repository at this point in the history
  • Loading branch information
SebassNoob committed Jun 16, 2023
1 parent da6c3e3 commit 66be574
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion holy-grail-frontend/src/features/Developer/TabContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export const TabContent = ({
validData.slice(i, i + chunkSize)
);
};
console.log(pagedData);
return pagedData;
}

Expand All @@ -82,6 +81,8 @@ export const TabContent = ({
placeholder={`Search for ${title}`}
onChange={(event: React.ChangeEvent<HTMLInputElement>) => {
setQuery(event.target.value);
//go back to first page to prevent overflow
setPage(0);
handleValidData();

}}
Expand All @@ -103,6 +104,8 @@ export const TabContent = ({
rowsPerPageOptions={[5,10,15,20]}
onRowsPerPageChange={(event: React.ChangeEvent<HTMLInputElement>) => {
setChunkSize(parseInt(event.target.value));
//go back to first page to prevent overflow
setPage(0);
handlePaging();
}}
/>
Expand Down

0 comments on commit 66be574

Please sign in to comment.