carbon-addons-iot-react
carbon-addons-iot-react copied to clipboard
[Table] Pagination display incorrect when set number per page is 50 and total count is 158
Describe the bug total items and total pages are wrong after changing Items per page if login Assist after clearing cache
To Reproduce Steps to reproduce the behavior:
clear cache in Firefox or Safari or Chrome
Login Assist (IVT15), go to Admin - User tab, there are 158 items.
-
change Items per page from 20 to 100, got the second page. The total items is 158, which is correct.
-
change Items per page from 100 to 50, the total items is chagned to be 100, the total pages is 2,. The total items number should be 158 and pages number should be 3.
-
change items per page from 100 to 50, the total items is wrong and total pages is wrong.
Expected behavior The total items should always be 158. the page number should be changed according to the Items per page.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS: MAC Browser: Fire, Chrome, Firefox.
seems simiar as https://github.com/carbon-design-system/carbon-addons-iot-react/issues/2156
@zhaozhuo813 Can you reproduce in Storybook? https://next.carbon-addons-iot-react.com/?path=/story/1-watson-iot-table--playground We do not have access to the MAS Core github repo, so it's hard to know if this is coming from the application or from the component.
I can not reproduce data in Story book but I reproduce issue in storybook when I set total count = 158 and page size = 100, I got no data in table error when I turn to second page
@JordanWSmith15
I can not reproduce data in Story book but I reproduce issue in storybook when I set total count = 158 and page size = 100, I got no data in table error when I turn to second page
@JordanWSmith15
@zhaozhuo813
The reason why it shows There is no data
in the story is because data
object is hardcoded to only have 100 rows. There is no more data after the first page. Even we set totalItems to 158 but the actual data still has 100 rows. I can update the story with a non hardcoded data object.
It still does not reproduce the issue you saw in your environment. totalItem
refers to data.length
, does data object change in your environment? Can we access your environment to debug? Thank you!
@jessieyan Hi, I found there was something wrong in my code, so the root cause is not in carbon side, and I think this issue can be closed. Let me close this and it would be good if you will update the story book without hardcode data. Thanks