-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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. Default current page is 1 but documentation says 0 #1841
Comments
I think that your main problem is that you are setting the In other words, the pagination should be hidden or have no pages at all till the collection size is known. Having said all the above I'm not clear from your description what is the practical use-case so hard to offer more info...
in this case page changes from |
Is this really a bug or just a documentation update? It seems like any invalid input to page should be set to 1. I'm anxious to get some of the other fixes in this milestone and would be willing to help out if something needs to be done, but this really doesn't seem like it warrants a bug in the framework. |
Docs need to be updated, the page can clearly never be zero, only 1 from a user perspective. <!-- page stays undefined → OK -->
<ngb-pagination (pageChange)="page = $event"></ngb-pagination>
<!-- page = 1 → OK -->
<ngb-pagination [collectionSize]="20" (pageChange)="page = $event"></ngb-pagination>
<!-- page = 1 → should not fire as collection size is not set-->
<ngb-pagination [page]="5" (pageChange)="page = $event"></ngb-pagination> Will open a PR with updates |
Because of default current page is 1 you can't ignore first loading. Furthermore you can't override it because any incorrect value is transformed to 1
Second question is why paginator calls
pageChange
callback with default page number after page was loaded?http://plnkr.co/edit/VGeIFzcKzGeQV8MNGQus?p=preview
ng-bootstrap: v1.0.0-beta.4
The text was updated successfully, but these errors were encountered: