-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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(Pagination): dont reset page to 1 for pageSizes #4239
fix(Pagination): dont reset page to 1 for pageSizes #4239
Conversation
Deploy preview for the-carbon-components ready! Built with commit d25bb1e https://deploy-preview-4239--the-carbon-components.netlify.com |
Deploy preview for carbon-elements failed. Built with commit d25bb1e https://app.netlify.com/sites/carbon-elements/deploys/5d9d4537b0b233000a202ad7 |
Deploy preview for carbon-components-react ready! Built with commit d25bb1e https://deploy-preview-4239--carbon-components-react.netlify.com |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks good to me
Co-Authored-By: emyarod <emyarod@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 - Thanks @stvcisco!
Closes #4217
Page number was resetting to 1 whenever the pageSizes list changed. This was too aggressive since it's not necessary unless the actual pageSize (ie Items-per-page) changes.
Changelog
Adjust the pageSIze value if necessary (ie, the new list of pageSizes does not include the current pageSize). Then reset page to 1 only if pageSizeChanged.
Testing / Reviewing
Added unit tests for these cases.