Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix useList pagination total #6500

Merged
merged 3 commits into from
Aug 24, 2021
Merged

Conversation

yksflip
Copy link
Contributor

@yksflip yksflip commented Aug 11, 2021

The current implementation to calculate the total in useList is broken. finalItems.ids.length changes once pagination is rendered (useList.ts#L192) . So the value of total equals perPage.
I think using the ids.length instead would be appropriate to fix this.

Copy link
Member

@fzaninotto fzaninotto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

packages/ra-core/src/controller/useList.ts Outdated Show resolved Hide resolved
@fzaninotto fzaninotto merged commit 34e65d3 into marmelab:master Aug 24, 2021
@fzaninotto
Copy link
Member

Thanks!

@fzaninotto fzaninotto added this to the 3.17.3 milestone Aug 24, 2021
@yksflip yksflip deleted the fix_useList_total branch October 6, 2021 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants