Internal issue 3163 - Issue with the Pagination Bar component
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 53
- Forks
- 63
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 15
Description
We're trying to upgrade to ICDS v3, which includes updating the pagination bar component: [Pagination bar - Intelligence Community Design System](https://design.sis.gov.uk/components/navigation/pagination-bar/code/)
Quite quickly we get into a position where we display {{Infinity}} on the pagination bar:
And the issue has been isolated to when the number of total items is less than the first item in itemsPerPageOptions (or the prop for itemsPerPageOptions isn't passed in at all)
e.g.
Plain Text
```
```
I've created a stackblitz to reproduce this issue here: [ICDS Pagination Bar (React component) -](https://stackblitz.com/edit/kr1yrgwg?file=src%2Fapp.tsx&hideExplorer=1)
----
Expected behaviour: When totalItems is < the smallest itemsPerPageOptions value, then Items per page Select should display provided options (instead of 'no results available') and the indicator should display 'Page 1 of 1'.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked StackBlitz reproduction and the Pagination bar component documentation, then trace how totalItems and itemsPerPageOptions determine the select state and page count. Confirm the behavior for totalItems=24 with options starting at 25, and when itemsPerPageOptions is omitted. Done means the provided options remain available and the indicator displays “Page 1 of 1” instead of Infinity or “no results available”.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100