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

Added flag to enable 1-indexed pagination structure. #224

Closed
wants to merge 10 commits into from

Conversation

jpedroribeiro
Copy link

@jpedroribeiro jpedroribeiro commented Aug 3, 2018

This fixes the issues #207, #167 by giving the user an option to have its pagination 0-indexed or 1-indexed.

Edit: adding issue

@@ -52,6 +52,8 @@
"demo": "webpack --config demo/webpack.config.js --mode=development && node demo/data.js && node demo/server.js"
},
"jest": {
"verbose": true,
"testURL": "http://localhost/",
Copy link
Author

Choose a reason for hiding this comment

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

Tests were failing. After looking into Jest repo/community, this is what the recommendation was.
This might also fix other PRs like #223

hrefBuilder,
pageCount,
oneIndexed
} = this.props;
if (hrefBuilder &&
pageIndex !== this.state.selected &&
pageIndex >= 0 &&

Choose a reason for hiding this comment

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

Shouldn't that be pageIndex >= (oneIndexed ? 1 : 0) as well?

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