Skip to content

Bug - Table -> React demos -> Sortable-responsive - incorrect pagination in readme demo #9834

@keckrich

Description

@keckrich

Describe the problem
In the readme under Tables -> React demos -> Sortable - responsive in the React.useEffect
setSortedRows(sortedData.slice((page - 1) * perPage, page * perPage - 1)); should be setSortedRows(sortedData.slice((page - 1) * perPage, page * perPage)); because slice end is exclusive. The demo code says the pagination is pages 1-10 but only shows nine results.

Expected behavior
The example code should be changed to

React.useEffect(() => { 
    setSortedRows(sortedData.slice((page - 1) * perPage, page * perPage));
}, [sortedData, page, perPage]);

What is your environment?

  • Readme: Release 5.1.0

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions