You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The gist of the issue is the next page button gets disabled when passing undefined for total items. In a case where the user is doing server-side paging, they don't know the total items, so we were passing undefined to represent that.
This PR added a default to totalItems in Pagination. Previously, we were passing undefined for totalItems in the case of server-side paging, which worked fine. Now, totalItems gets defaulted to 1 and the next page button gets disabled.
It looks like typescript was complaining when the default wasn't there, but we can make other changes to make typescript happy. Was there another reason the default needed to be added? I wouldn't think so; doesn't seem logical to just default to 1 total item.
I can put out a PR to fix this too, but would like confirmation on the expectation. There's also another oddity with how the dropdown works for pages in this scenario that we can talk more about on Slack.
Package
@carbon/react
Browser
Chrome
Package version
v1.56.0
React version
v16
Description
The gist of the issue is the next page button gets disabled when passing
undefined
for total items. In a case where the user is doing server-side paging, they don't know the total items, so we were passingundefined
to represent that.This PR added a default to
totalItems
in Pagination. Previously, we were passingundefined
for totalItems in the case of server-side paging, which worked fine. Now,totalItems
gets defaulted to 1 and the next page button gets disabled.It looks like typescript was complaining when the default wasn't there, but we can make other changes to make typescript happy. Was there another reason the default needed to be added? I wouldn't think so; doesn't seem logical to just default to 1 total item.
I can put out a PR to fix this too, but would like confirmation on the expectation. There's also another oddity with how the dropdown works for pages in this scenario that we can talk more about on Slack.
Reproduction/example
https://stackblitz.com/edit/github-uanwpm?file=src%2FApp.jsx
Steps to reproduce
Set up pagination with pagesUnknown and don't pass totalItems.
Suggested Severity
Severity 3 = User can complete task, and/or has a workaround within the user experience of a given component.
Application/PAL
cloud-pal-community and consumers in IBM
Code of Conduct
The text was updated successfully, but these errors were encountered: