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(Pagination): dont reset page to 1 for pageSizes #4239

Merged
merged 3 commits into from
Oct 9, 2019

Conversation

stvcisco
Copy link
Contributor

@stvcisco stvcisco commented Oct 7, 2019

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.

@netlify
Copy link

netlify bot commented Oct 7, 2019

Deploy preview for the-carbon-components ready!

Built with commit d25bb1e

https://deploy-preview-4239--the-carbon-components.netlify.com

@netlify
Copy link

netlify bot commented Oct 7, 2019

Deploy preview for carbon-elements failed.

Built with commit d25bb1e

https://app.netlify.com/sites/carbon-elements/deploys/5d9d4537b0b233000a202ad7

@netlify
Copy link

netlify bot commented Oct 7, 2019

Deploy preview for carbon-components-react ready!

Built with commit d25bb1e

https://deploy-preview-4239--carbon-components-react.netlify.com

Copy link
Member

@emyarod emyarod left a 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

packages/react/src/components/Pagination/Pagination.js Outdated Show resolved Hide resolved
Co-Authored-By: emyarod <emyarod@users.noreply.github.com>
Copy link
Contributor

@asudoh asudoh left a comment

Choose a reason for hiding this comment

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

LGTM 👍 - Thanks @stvcisco!

@asudoh asudoh merged commit 325f168 into carbon-design-system:master Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

carbon-components-react Pagination should not reset page number to 1 when itemsPerPage choices change
5 participants