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

Pagination is zero indexed with no warning or notice #1667

Closed
iMerica opened this issue Mar 5, 2019 · 4 comments
Closed

Pagination is zero indexed with no warning or notice #1667

iMerica opened this issue Mar 5, 2019 · 4 comments
Labels
documentation Issues or PRs that only affect documentation - will not need changelog entries good first issue

Comments

@iMerica
Copy link

iMerica commented Mar 5, 2019

Hi,

Off by one errors will occur to anyone who simply reads the docs as is. It would be helpful to explicitly tell users in the Pagination docs that page numbers start at zero. There is no standard and LOTS of APIs observe the first page as page 1.

Thanks,

Michael

https://elastic.github.io/eui/#/navigation/pagination

@snide snide added documentation Issues or PRs that only affect documentation - will not need changelog entries good first issue labels Mar 5, 2019
@theodesp
Copy link
Contributor

theodesp commented Mar 16, 2019

I can take this. I was thinking of adding an info EuiCallOut with the following text:

Pagination page numbers start at zero (0). So if you set the activePage to 1, it will activate the second page.

Is that OK?

@snide
Copy link
Contributor

snide commented Mar 16, 2019

I think just adding it to the props doc here will work well enough. I don't think this is something that needs to be a major warning. The props doc will do.

https://github.com/elastic/eui/blob/master/src/components/pagination/pagination.js#L192

Note how the comments in the propTypes here turn into documentation in the Props tab on the docs page.

@iMerica
Copy link
Author

iMerica commented Mar 16, 2019

Anything that makes it show up on the Pagination docs page would be great 👍

@thompsongl
Copy link
Contributor

Docs added in #1740

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Issues or PRs that only affect documentation - will not need changelog entries good first issue
Projects
None yet
Development

No branches or pull requests

4 participants