Skip to content

Bug with pagination in table #6163

@moslienko

Description

@moslienko

Description

Image
Hello, when using a table with pagination, when going to page 3, the pagination is displayed incorrectly (see screenshot), i.e. the "3" indicator stops showing and two numbers "5" appear. This happens when there are only 5 pages, in my case there are only 44 records in the table, 10 per page.

<Table.Pagination
                aria-label="Pagination for Repositories"
                pageSize={pageSize}
                totalCount={repos.length}
                onChange={({ pageIndex }) => {
                    setPageIndex(pageIndex)
                }}
            />
...

for (let i = 0; i < 44; i++) {
    repos.push({
        id: i,
        name: `Repository ${i + 1}`,
        type: i % 3 === 0 ? 'Internal' : 'Public',
        updatedAt: now - 1000 * 60 * 60 * 24 * i,
        securityFeatures: {
            dependabot: '',
            codeScanning: '',
        },
    })
}

Steps to reproduce

  1. Create a table with ~44 rows of data so that there are 5 pages
  2. Go to page number 3

Version

v37.24.0

Browser

Firefox

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingreact

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions